You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code completion sometimes insert "(...)" instead of expected parameter snippets #4027
Looks like it's always been the case that the VS Code LSP client is dropping insertText when textEdit is supplied, however we only started doing that with dart-lang/sdk@40e25eb to fix another bug.
This is happening again / still happening on latest:
==>{"jsonrpc": "2.0","id": 2578,"method": "completionItem/resolve","params": {"label": "RegExp(…)","detail": "(String source, {bool multiLine = false, bool caseSensitive = true, @Since(\"2.4\") bool unicode = false, @Since(\"2.4\") bool dotAll = false}) → RegExp","filterText": "RegExp","insertTextFormat": 2,"textEdit": {"newText": "RegExp(${0:source})","range": {"start": {"line": 78,"character": 51},"end": {"line": 78,"character": 55}}},"kind": 4,"sortText": "9999966","command": {"title": "Suggest","command": "editor.action.triggerParameterHints"},"data": {"displayUri": "dart:core","file": "/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analysis_server/test/lsp/call_hierarchy_test.dart","iLength": 4,"libId": 69,"offset": 2319,"rLength": 4,"rOffset": 2315}},"clientRequestTime": 1657711930723}<=={"id": 2578,"jsonrpc": "2.0","result": {"additionalTextEdits": [],"command": {"command": "editor.action.triggerParameterHints","title": "Suggest"},"data": {"displayUri": "dart:core","file": "/Users/danny/Dev/Google/dart-sdk/sdk/pkg/analysis_server/test/lsp/call_hierarchy_test.dart","iLength": 4,"libId": 69,"offset": 2319,"rLength": 4,"rOffset": 2315},"detail": "(String source, {bool multiLine = false, bool caseSensitive = true, @Since(\"2.4\") bool unicode = false, @Since(\"2.4\") bool dotAll = false}) → RegExp","documentation": {"kind": "markdown","value": "A regular expression pattern.\n\nRegular expressions are [Pattern]s, and can as such be used to match strings\nor parts of strings.\n\nDart regular expressions have the same syntax and semantics as\nJavaScript regular expressions. See\n<https://ecma-international.org/ecma-262/9.0/#sec-regexp-regular-expression-objects>\nfor the specification of JavaScript regular expressions.\n\nThe [firstMatch] method is the main implementation method\nthat applies a regular expression to a string\nand returns the first [RegExpMatch].\nAll other methods in [RegExp] can be build from that.\n\nThe following example finds the first match of a regular expression in\na string.\n```dart\nRegExp exp = RegExp(r'(\\w+)');\nString str = 'Parse my string';\nRegExpMatch? match = exp.firstMatch(str);\nprint(match![0]); // \"Parse\"\n```\nUse [allMatches] to look for all matches of a regular expression in\na string.\n\nThe following example finds all matches of a regular expression in\na string.\n```dart\nRegExp exp = RegExp(r'(\\w+)');\nString str = 'Parse my string';\nIterable<RegExpMatch> matches = exp.allMatches(str);\nfor (final m in matches) {\n print(m[0]);\n}\n```\nThe output of the example is:\n```\nParse\nmy\nstring\n```\n\nNote the use of a _raw string_ (a string prefixed with `r`)\nin the example above. Use a raw string to treat each character in a string\nas a literal character."},"filterText": "RegExp","insertText": "RegExp(…)","insertTextFormat": 2,"kind": 4,"label": "RegExp(…)","sortText": "9999966","textEdit": {"newText": "RegExp(…)","range": {"end": {"character": 55,"line": 78},"start": {"character": 51,"line": 78}}}}}
@athomas FYI, there are some files with old dates at https://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/ again. I don't know if they're stuck, or they're old (for example mostly they're md5sum files and I see there are now sha256sum files, so maybe the md5 ones are no longer used, but having them there and not matching the latest versions may be confusing?).
Activity
DanTup commentedon Jun 22, 2022
This is odd.. the original completion from the server looks like this:
However the
resolverequest includes this (note thatinsertTextis missing):DanTup commentedon Jun 22, 2022
Looks like it's always been the case that the VS Code LSP client is dropping
insertTextwhentextEditis supplied, however we only started doing that with dart-lang/sdk@40e25eb to fix another bug.[analysis_server] [lsp] Fix resolving completions with no insertText …
DanTup commentedon Jun 22, 2022
Fixed by dart-lang/sdk@14796fa.
DanTup commentedon Jul 13, 2022
This is happening again / still happening on latest:
DanTup commentedon Jul 13, 2022
Turns out the SDK I downloaded today is from 21st June and not today. There seems to be an old SDK (without the
-releasesuffix) here:https://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/
@athomas not sure if you're best person to ask - is it intended that are there some older SDK builds in that folder or should they be removed?
athomas commentedon Jul 13, 2022
@DanTup thanks for highlighting this, I cleaned this up.
DanTup commentedon Nov 15, 2022
@athomas FYI, there are some files with old dates at https://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/ again. I don't know if they're stuck, or they're old (for example mostly they're md5sum files and I see there are now sha256sum files, so maybe the md5 ones are no longer used, but having them there and not matching the latest versions may be confusing?).