Comments (7)
Are you setting the resolveSupport
client configuration data to indicate that these fields can be returned later? More generally, please let us know what client configuration data you're sending to the server.
from sdk.
Currently, resolve
is only used for completion items that are not already imported. For all things currently in-scope, the documentation (and other fields) are included inline. This is one of the things noted at #53501 (I believe there was something that made it non-trivial, but I don't recall the specifics right now).
You can control the level of documentation that is included (here and in hovers) with the dart.documentation
configuration setting and you can also reduce the number of items included with the "dart.maxCompletionItems"
setting.
from sdk.
resolveSupport
yes, I have set the resolveSupport. My capabilities are as follows:
But it still return the documentation field, which is a very large content
Map<String, dynamic> clientCapabilities = {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": ["create", "rename", "delete"],
"failureHandling": "textOnlyTransactional",
"normalizesLineEndings": true,
"changeAnnotationSupport": {"groupsOnLabel": true}
},
"configuration": true,
"didChangeWatchedFiles": {
"dynamicRegistration": true,
"relativePatternSupport": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"tagSupport": {
"valueSet": [1]
},
"resolveSupport": {
"properties": ["location.range"]
}
},
"codeLens": {"refreshSupport": true},
"executeCommand": {"dynamicRegistration": true},
"didChangeConfiguration": {"dynamicRegistration": true},
"workspaceFolders": true,
"semanticTokens": {"refreshSupport": true},
"fileOperations": {
"dynamicRegistration": true,
"didCreate": true,
"didRename": true,
"didDelete": true,
"willCreate": true,
"willRename": true,
"willDelete": true
},
"inlineValue": {"refreshSupport": true},
"inlayHint": {"refreshSupport": true},
"diagnostics": {"refreshSupport": true}
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false,
"tagSupport": {
"valueSet": [1, 2]
},
"codeDescriptionSupport": true,
"dataSupport": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": ["markdown", "plaintext"],
"deprecatedSupport": true,
"preselectSupport": true,
"tagSupport": {
"valueSet": [1]
},
"insertReplaceSupport": true,
"resolveSupport": {
"properties": ["documentation", "detail", "additionalTextEdits"]
},
"insertTextModeSupport": {
"valueSet": [1, 2]
},
"labelDetailsSupport": true
},
"insertTextMode": 2,
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
},
"completionList": {
"itemDefaults": [
"commitCharacters",
"editRange",
"insertTextFormat",
"insertTextMode"
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": ["markdown", "plaintext"]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": ["markdown", "plaintext"],
"parameterInformation": {"labelOffsetSupport": true},
"activeParameterSupport": true
},
"contextSupport": true
},
"definition": {"dynamicRegistration": true, "linkSupport": true},
"references": {"dynamicRegistration": true},
"documentHighlight": {"dynamicRegistration": true},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true,
"tagSupport": {
"valueSet": [1]
},
"labelSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"disabledSupport": true,
"dataSupport": true,
"resolveSupport": {
"properties": ["edit"]
},
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"honorsChangeAnnotations": false
},
"codeLens": {"dynamicRegistration": true},
"formatting": {"dynamicRegistration": true},
"rangeFormatting": {"dynamicRegistration": true},
"onTypeFormatting": {"dynamicRegistration": true},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true,
"prepareSupportDefaultBehavior": 1,
"honorsChangeAnnotations": true
},
"documentLink": {"dynamicRegistration": true, "tooltipSupport": true},
"typeDefinition": {"dynamicRegistration": true, "linkSupport": true},
"implementation": {"dynamicRegistration": true, "linkSupport": true},
"colorProvider": {"dynamicRegistration": true},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true,
"foldingRangeKind": {
"valueSet": ["comment", "imports", "region"]
},
"foldingRange": {"collapsedText": false}
},
"declaration": {"dynamicRegistration": true, "linkSupport": true},
"selectionRange": {"dynamicRegistration": true},
"callHierarchy": {"dynamicRegistration": true},
"semanticTokens": {
"dynamicRegistration": true,
"tokenTypes": [
"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator",
"decorator"
],
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"formats": ["relative"],
"requests": {
"range": true,
"full": {"delta": true}
},
"multilineTokenSupport": false,
"overlappingTokenSupport": false,
"serverCancelSupport": true,
"augmentsSyntaxTokens": true
},
"linkedEditingRange": {"dynamicRegistration": true},
"typeHierarchy": {"dynamicRegistration": true},
"inlineValue": {"dynamicRegistration": true},
"inlayHint": {
"dynamicRegistration": true,
"resolveSupport": {
"properties": [
"tooltip",
"textEdits",
"label.tooltip",
"label.location",
"label.command"
]
}
},
"diagnostic": {"dynamicRegistration": true, "relatedDocumentSupport": false}
},
"window": {
"showMessage": {
"messageActionItem": {"additionalPropertiesSupport": true}
},
"showDocument": {"support": true},
"workDoneProgress": true
},
"general": {
"staleRequestSupport": {
"cancel": true,
"retryOnContentModified": [
"textDocument/semanticTokens/full",
"textDocument/semanticTokens/range",
"textDocument/semanticTokens/full/delta"
]
},
"regularExpressions": {"engine": "ECMAScript", "version": "ES2020"},
"markdown": {
"parser": "marked",
"version": "1.1.0",
"allowedTags": [
"ul",
"li",
"p",
"code",
"blockquote",
"ol",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"em",
"pre",
"table",
"thead",
"tbody",
"tr",
"th",
"td",
"div",
"del",
"a",
"strong",
"br",
"img",
"span"
]
},
"positionEncodings": ["utf-16"]
},
"notebookDocument": {
"synchronization": {
"dynamicRegistration": true,
"executionSummarySupport": true
}
},
"experimental": {
"supportsWindowShowMessageRequest": true,
"snippetTextEdit": true,
"dartCodeAction": {
"commandParameterSupport": {
"supportedKinds": ["saveUri"]
}
}
}
};
from sdk.
@onism0106 have you tried changing the dart.documentation
(or dart.maxCompletionItems
) settings noted above?
For now, I think those are the only options that will help here, until we support resolve
for the already-in-scope items.
Out of interest - what problem is the payload size causing you? (memory usage? time taken to deserialize json? time to send bytes between server and client?). Is your editor open source?
from sdk.
I started looking at why we didn't use /resolve
for documentation generally and added some notes in #53501 (comment). It was mostly that I was hoping that microsoft/language-server-protocol#1802 would be implemented which would avoid us having to add so much to the payload in order to use /resolve
here.
from sdk.
@onism0106 have you tried changing the
dart.documentation
(ordart.maxCompletionItems
) settings noted above?For now, I think those are the only options that will help here, until we support
resolve
for the already-in-scope items.Out of interest - what problem is the payload size causing you? (memory usage? time taken to deserialize json? time to send bytes between server and client?). Is your editor open source?
Yes, I am worried about performance issues because there will be frequent interactions with the LSP, each time returning a large amount of data. I am concerned that this might cause performance problems,(memory usage? time taken to deserialize json).
I don't know if my concern is unnecessary.
I'll try set dart.documentation (or dart.maxCompletionItems) later
from sdk.
If it helps, the payload sizes you're seeing here match what VS Code is dealing with today. I can't be sure the equivalent Dart code performs the same as VS Code's javascript, but hopefully it won't cause any real performance issues.
However, I have pinged on the LSP issue about this, and depending on the response (or lack of), may try to progress something in this area (because there is value in reducing payload sizes for some other situations, like when the extension host/LSP server is on a remote machine).
from sdk.
Related Issues (20)
- Analyzer Feedback from IntelliJ HOT 1
- dart2js memory usage output always 0
- Coverage reports differ when --optimization-counter-threshold=-1 is used HOT 5
- vm/dart/isolates/shared_test flakily fails on vm-reload-linux-release-x64 HOT 3
- Pre-built Stack Class in the Dart Standard Library HOT 2
- Data driven fix: Replacing a method with a getter when method has been removed does not work correctly
- Never-bounded types cause CFE crash
- [dartdev] `Could not find dart. Have you built the full Dart SDK?` on `dart build` HOT 7
- [infra] More frequent dev releases HOT 1
- Consider dropping instructions after return, throw, unreachable, br in wasm_builder
- Consider optimizing `x < 0 || x > positiveInt` to single unsigned comparison
- Analyzer Feedback from IntelliJ HOT 4
- Failures on [dart2wasm] Use unsafeCast in a few places...Reland "[vm] Move `ResolveUri` to bin" HOT 1
- Analyzer data-based fix request HOT 2
- `dart compile js` fails with the newest SDK HOT 17
- Cannot resolve top-level methods with docimports HOT 4
- [Wildcard Variables] Update `DUPLICATE_DEFINTION` reporting
- CFE fails to report error when `super` is used in a redirecting constructor. HOT 2
- DevTools not serving properly on app refresh HOT 1
- [Wildcard Variables] Update `DUPLICATE_FIELD_FORMAL_PARAMETER` reporting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.