question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript and intellisense often randomly opens with "if" snippet selected ignoring any properties

See original GitHub issue

Issue Type: Bug

Declare an interface with some properties. Create a function with parameter type of that interface.

Call function with object declared inside function call. Press CTRL + SPACE and note how usually the intellisense prompt will open approximately half way through the options with the “if” snippet selected. The user then has to manually scroll to the top of the list in order to see the properties expected.

interface Something {
    propertyOne: any,
    propertyTwo: any,
};

const someFunction = (something: Something) => {};

someFunction({ <focus here and press CTRL + SPACE> });

image

The user then has to scroll to the top:

image

I suggest that the intellisense menu scrolls to the very top always (why is it currently in the middle, for example). TypeScript has already inferred what properties are available, so it should be a case of fixing the default selected item in the intellisense menu.

VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:59:35.033Z) OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel® Xeon® CPU E5-1650 v4 @ 3.60GHz (12 x 3592)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: unavailable_off
protected_video_decode: unavailable_off
rasterization: unavailable_off
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.92GB (4.16GB free)
Process Argv –folder-uri <redacted>
Screen Reader no
VM 0%
Extensions (26)
Extension Author (truncated) Version
Bookmarks ale 10.4.4
simple-react-snippets bur 1.2.2
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
bracket-pair-colorizer-2 Coe 0.0.28
prettier-vscode esb 1.9.0
auto-close-tag for 0.5.6
auto-rename-tag for 0.1.0
vscode-react-typescript inf 1.3.0
vscode-peacock joh 2.4.0
TypeScriptImport kev 1.17.0
rainbow-csv mec 1.1.1
vscode-less mrm 0.6.3
azure-account ms- 0.8.4
vscode-typescript-tslint-plugin ms- 1.2.2
vetur oct 0.21.1
vue-vscode-extensionpack sdr 0.2.0
vue-vscode-snippets sdr 1.7.1
ayu tea 0.18.0
vscode-status-bar-format-toggle tom 1.5.0
terminal-tabs Tyr 0.2.0
highlight-matching-tag vin 0.9.2
WebTemplateStudio-dev-nightly WAS 0.0.1919601
vscode-import-cost wix 2.12.0
vscode-jumpy wma 0.3.1
JavaScriptSnippets xab 1.7.2

(1 theme extensions excluded)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ffxsamcommented, Jul 22, 2019

Also agree with @lloydjatkinson, "first" ought to be the default. The other default behavior is disorienting. And there’s still a bug here regarding how auto-suggest behaves when whitespace is added.

1reaction
jriekencommented, Jul 22, 2019

@lloydjatkinson Do you have the editor.snippetSuggestions-setting configured?

This is because of the editor.suggestSelection-setting. The default is to preselect the least recent used item (unless any other item is selected). You can change the value of that setting to first to get out of this, not sure how to make the default better tho…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove snippets from intellisense? - Stack Overflow
When using VSCode you get a bunch of unnecessary items when you Ctrl+Space inside of a React component. Any idea how to remove...
Read more >
User and Workspace Settings - Visual Studio Code
The first time you open a workspace that defines any of these settings, VS Code will warn you and then always ignore the...
Read more >
The reasons I don't use Typescript - DEV Community ‍ ‍
I find it all to be too big, too fussy, too much in the way, and too non-revolutionary to justify the cost. If...
Read more >
Azure Application Insights for JavaScript web apps
Application Insights can be used with any webpages by adding a short ... If you use the npm setup, don't use the snippet...
Read more >
Typescript cannot assign to read only property
Again, if we transpile this code, we can see what TypeScript generates for us. ... IntelliSense Feb 03, 2020 · This is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found