Skip to content

Commit c7e7cbd

Browse files
DanTupcommit-bot@chromium.org
authored andcommitted
Remove workaround for LSP spec issue
+ regen the file, which updated comments that were improved in the spec since the last time. Change-Id: Ib46cabcbc6e22d778847891f309f9be5e354720c Reviewed-on: https://dart-review.googlesource.com/c/87580 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Danny Tuppeny <[email protected]>
1 parent b9170ff commit c7e7cbd

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,6 +2988,18 @@ class DocumentFilter implements ToJsonable {
29882988
final String language;
29892989

29902990
/// A glob pattern, like `*.{ts,js}`.
2991+
///
2992+
/// Glob patterns can have the following syntax:
2993+
/// - `*` to match one or more characters in a path segment
2994+
/// - `?` to match on one character in a path segment
2995+
/// - `**` to match any number of path segments, including none
2996+
/// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript
2997+
/// and JavaScript files)
2998+
/// - `[]` to declare a range of characters to match in a path segment (e.g.,
2999+
/// `example.[0-9]` to match on `example.0`, `example.1`, …)
3000+
/// - `[!...]` to negate a range of characters to match in a path segment
3001+
/// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not
3002+
/// `example.0`)
29913003
final String pattern;
29923004

29933005
/// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
@@ -3770,7 +3782,9 @@ class DocumentSymbol implements ToJsonable {
37703782
/// The kind of this symbol.
37713783
final SymbolKind kind;
37723784

3773-
/// The name of this symbol.
3785+
/// The name of this symbol. Will be displayed in the user interface and
3786+
/// therefore must not be an empty string or a string only consisting of white
3787+
/// spaces.
37743788
final String name;
37753789

37763790
/// The range enclosing this symbol not including leading/trailing whitespace
@@ -4243,7 +4257,19 @@ class FileSystemWatcher implements ToJsonable {
42434257
return new FileSystemWatcher(globPattern, kind);
42444258
}
42454259

4246-
/// The glob pattern to watch
4260+
/// The glob pattern to watch.
4261+
///
4262+
/// Glob patterns can have the following syntax:
4263+
/// - `*` to match one or more characters in a path segment
4264+
/// - `?` to match on one character in a path segment
4265+
/// - `**` to match any number of path segments, including none
4266+
/// - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript
4267+
/// and JavaScript files)
4268+
/// - `[]` to declare a range of characters to match in a path segment (e.g.,
4269+
/// `example.[0-9]` to match on `example.0`, `example.1`, …)
4270+
/// - `[!...]` to negate a range of characters to match in a path segment
4271+
/// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not
4272+
/// `example.0`)
42474273
final String globPattern;
42484274

42494275
/// The kind of events of interest. If omitted it defaults to WatchKind.Create
@@ -4656,7 +4682,12 @@ class InitializeParams implements ToJsonable {
46564682
/// The capabilities provided by the client (editor or tool)
46574683
final ClientCapabilities capabilities;
46584684

4659-
/// User provided initialization options.
4685+
/// Client provided initialization options. Usually these are options that
4686+
/// could equally be command line options passed when starting the server.
4687+
/// This property shouldn't be used to pass any user configuration to the
4688+
/// server. If a user configuration is needed the server should use
4689+
/// `workspace/configuration` requests together with dynamic registration to
4690+
/// obtain them.
46604691
final dynamic initializationOptions;
46614692

46624693
/// The process Id of the parent process that started the server. Is null if

pkg/analysis_server/tool/lsp_spec/typescript_parser.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,7 @@ class Parser {
379379
_consume(TokenType.LEFT_BRACE, 'Expected {');
380380
final members = <Member>[];
381381
while (!_check(TokenType.RIGHT_BRACE)) {
382-
final member = _member(name.lexeme);
383-
// TODO(dantup): Remove this temp workaround once spec is fixed/clarified.
384-
// https://github.com/Microsoft/language-server-protocol/issues/643
385-
if (members.any((m) => m.name == member.name)) {
386-
print('Skipping duplicate member ${member.name} in ${name.lexeme}');
387-
continue;
388-
}
389-
members.add(member);
382+
members.add(_member(name.lexeme));
390383
}
391384

392385
_consume(TokenType.RIGHT_BRACE, 'Expected }');

0 commit comments

Comments
 (0)