Skip to content

Commit d75a4e1

Browse files
DanTupCommit Queue
authored and
Commit Queue
committed
[analysis_server] Update LSP generated classes to latest published version of the spec
No functional changes here but there have been some refactors inside the meta model that required some minor tweaks (URI moved from a type alias to string to a spec-defined base type). I also improved the handling of some type references in the comments we bring in so they're clickable in more places. Change-Id: I7c725d01b6d7bc0925979b8118dbfd8952f78724 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297482 Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 3a5b06a commit d75a4e1

File tree

7 files changed

+593
-509
lines changed

7 files changed

+593
-509
lines changed

pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart

Lines changed: 227 additions & 241 deletions
Large diffs are not rendered by default.

pkg/analysis_server/test/tool/lsp_spec/json_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ void main() {
452452
InitializeParamsClientInfo(name: 'server name', version: '1.2.3'),
453453
rootPath: '!root',
454454
capabilities: ClientCapabilities(),
455-
trace: 'off',
455+
trace: TraceValues.Off,
456456
workspaceFolders: workspaceFolders,
457457
);
458458
final json = jsonEncode(obj);

pkg/analysis_server/tool/lsp_spec/codegen_dart.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ bool enumClassAllowsAnyValue(String name) {
3737
name != 'FailureHandlingKind' &&
3838
name != 'InsertTextFormat' &&
3939
name != 'MarkupKind' &&
40-
name != 'ResourceOperationKind';
40+
name != 'ResourceOperationKind' &&
41+
name != 'TraceValues';
4142
}
4243

4344
String generateDartForTypes(List<LspEntity> types) {

pkg/analysis_server/tool/lsp_spec/generate_all.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ List<LspEntity> getCustomClasses() {
245245
baseType: TypeReference('Uri'),
246246
isRename: false,
247247
),
248+
// The LSP Spec uses "URI" but since that's fairly generic and will show up
249+
// everywhere in code completion, we rename it to "LspUri" before using
250+
// a typedef onto the Dart URI class.
251+
TypeAlias(
252+
name: 'URI',
253+
baseType: TypeReference('LSPUri'),
254+
isRename: true,
255+
),
248256
TypeAlias(
249257
name: 'LSPUri',
250258
baseType: TypeReference('Uri'),

0 commit comments

Comments
 (0)