Skip to content

Commit 9977ab7

Browse files
authored
Merge branch 'main' into fix-off-by-one-line-reporting
2 parents dc96f40 + ec3c8fd commit 9977ab7

File tree

23 files changed

+1516
-495
lines changed

23 files changed

+1516
-495
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,29 @@
44
-->
55
# Change Log
66

7+
## 0.9.13
8+
- Corrected the name of "explicit\_param\_decls" provisional. Note that it still
9+
has no semantic effect.
10+
- The parameter declaration patterns ":=" and ": \<type\> = \<val\>" are now
11+
correctly parsed.
12+
- You can now annotate dml source to disable reporting of specific lints for specific files or lines,
13+
see [USAGE.md](USAGE.md) for instructions on how to use it
14+
- Disabled the invariant check for the parameter 'size' to be set on register
15+
objects. Will be re-enabled when constant-folding is added to the DLS.
16+
- Fixed issue where statements under top-level in-eachs were not correctly tracked.
17+
- Moved storage of reference->symbol mapping to on-demand timing, should significantly speed
18+
up device analysises
19+
720
## 0.9.12
821
- Added 'simics\_util\_vect' as a known provisional (with no DLS semantics)
922
- Diagnostics sent from the server will now indicate their source as 'dml' or 'dml-lint'
1023
- Linting warnings can now annotate their messages with which linting rule enforces it. You can turn this off by setting 'annotate_lints' to 'false' in your lint config file
1124
- Minor fixes to the description of linting messages
1225
- Fixed an issue where diagnostics would sometime be reported within the wrong file
26+
- Corrected incorrect parsing around tuple-declared 'local' variables in for-loops
27+
- Added the ability to declare 'saved' or 'session' variables in for-loops
28+
- Added functionality for goto-def/decl/ref to or from variables declared
29+
within a function scope.
1330

1431
## 0.9.11
1532
- Fixed deadlock when a configuration update happens

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dls"
3-
version = "0.9.12"
3+
version = "0.9.13"
44
edition = "2018"
55
authors = []
66
description = "Simics DML language server"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ editors, and other tools with information about DML device and common code.
99
It currently supports basic syntax error reporting, symbol search,
1010
'goto-definition', 'goto-implementation', 'goto-reference', and 'goto-base'.
1111
It also has some basic configurable linting support, in the form of warning
12-
messages.
12+
messages. For user-targeted instructions, see [USAGE.md](USAGE.md).
1313

1414
Future planned features are extended semantic and type analysis, basic
1515
refactoring patterns, improved language construct templates, renaming

USAGE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
© 2024 Intel Corporation
3+
SPDX-License-Identifier: Apache-2.0 and MIT
4+
-->
5+
# Usage Instructions
6+
This document describes general instructions and advice directed at
7+
end-users of the DML language server. For advice or details on
8+
client implementation see [clients.md](clients.md). This document
9+
_only_ pertains to details that are client-agnostic. For client-specific
10+
details consult the documentation of the client.
11+
12+
As this file is currently a work in progress, relevant details may be
13+
missing or incomplete.
14+
15+
## In-Line Linting Configuration
16+
It may be desireable to control linting on a per-file basis, rather than
17+
relying on the linting configuration. This can be done with in-line
18+
linting configuration inside comments.
19+
20+
The general syntax is:
21+
`// dls-lint: <command>=<target>`
22+
Note that only one-line comments are allowed, and only if no text is between
23+
the comment start and 'dls-lint'.
24+
25+
Currently supported commands are:
26+
* 'allow-file' Will not report the lint rule specified by \<target> for the
27+
entire file, regardless of where 'allow-file' is declared
28+
* 'allow' Will not report the lint rule specified by \<target> for the next
29+
line without a leading comment, or for the current line if declared
30+
outside a leading comment.
31+
32+
Lint warnings will report which rule caused them in their message, which is the
33+
same identifier used for \<target>.
34+
35+
For example
36+
```
37+
// dls-lint: allow-file=long_lines
38+
method now_we_can_declare_this_method_with_a_really_really_really_really_long name() {
39+
40+
// dls-lint: allow=nsp_unary
41+
// dls-lint: allow=indent_no_tabs
42+
param p = (1 ++ *
43+
4); // dls-lint: allow=indent_paren_expr
44+
}
45+
```
46+
Will allow 'long_lines' globally, 'nsp_unary' and 'indent_no_tabs' on the
47+
`param p = (1 ++ *` line, and 'indent_paren_expr' on the `'4);` line.

src/actions/requests.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use serde::{Deserialize, Serialize};
88
use serde_json::Value;
99
use std::collections::HashSet;
1010
use std::path::Path;
11-
use std::sync::Arc;
1211

1312
use crate::actions::hover;
1413
use crate::actions::{AnalysisProgressKind, AnalysisWaitKind,
@@ -192,7 +191,6 @@ fn fp_to_symbol_refs<O: Output>
192191
for device in analysis.filtered_device_analysises_containing_file(
193192
&canon_path,
194193
filter.as_ref()) {
195-
debug!("reference info is {:?}", device.reference_info.keys());
196194
// NOTE: This ends up being the correct place to warn users
197195
// about references inside uninstantiated templates,
198196
// but we have to perform some extra work to find out we are
@@ -206,12 +204,9 @@ fn fp_to_symbol_refs<O: Output>
206204
any_template_used = true;
207205
}
208206
}
209-
if let Some(defs) = device.reference_info.get(
210-
refr.loc_span()) {
211-
for def in defs {
212-
definitions.push(Arc::clone(def));
213-
}
214-
}
207+
208+
definitions.append(
209+
&mut device.symbols_of_ref(*refr.loc_span()));
215210
}
216211
if let Some(ContextKey::Template(_)) = first_context {
217212
if !any_template_used {

0 commit comments

Comments
 (0)