Continued completion engine and intellisense upgrades
See original GitHub issueJust pulling this out of my PR for visibility and tracking, but this is a list of things I marked as TODOs for continuing to upgrade the completion engine and intellisense in VS to support newer Avalonia features and be smarter about the suggestions offered. Some of these are things implemented in the core completion engine, and some are more on the VS intellisense side (or both).
Just to recap what was in #275:
- Improved completion of pseudoclasses, including getting all pseudoclasses from the attribute
- Fixed handling completion on ‘.’ character so it does swallow the ‘.’ in something like
Window.Resources
- Fixed the double intellisense popup when adding xml namespaces
These are still left:
- find and list all defined resources instead of using static, hard-coded ones (hopefully, if not will add to future todos) that don’t really apply to anything outside the old default theme
- Ideally with this we need to make sure at least the active document (maybe even the current project) can update the suggestions more frequently without requiring a build (which is how the metadata is currently invalidated) as if you add a resource to the current file, I would expect it to immediately show without having to build the project. External assemblies could probably be cached like normal on build only since they’re static unless the ref is explicitly updated
- Filter out non-public types from suggestions
- @workgroupengineering Now that the completion engine is in this repo, you should be able to complete your PR (#216)
- Fix getting properties in nested style selectors. Nested style selectors without a type Selector=“^:pointerover” will fail to offer valid suggestions
- Add better context awareness for suggestions, including:
- filtering the suggestions to only include what makes sense at the given point in the document (this is mostly already how it is, but I think there are a few places where this could be improved, as an example, don’t suggest VerticalContentAlignment unless it absolutely makes sense to do so (only suggest VerticalAlignment)
- In a Style Selector, we could probably make it only suggest things that make sense given the cursor position, e.g., don’t suggest /template/ or pseudoclasses at the start of the selector, no pseudoclasses directly after /template/, etc
- In #275, I’ve also added some code to tell VS to auto select the first suggestion in the list - previously, it wouldn’t usually do this and you had to physically interact (mouse or arrow keys) to get the completion to work. We could probably improve this to guess the best item and select it instead based on context
- Only offering pseudoclasses valid for a particular control
- Don’t suggest properties that are already set on a given control, or within a particular Style block
- Fix editing existing text and accepting a completion
- Currently if you type
ponterover
and try to correct it, adding thei
will suggest:pointerover
, but accepting that completion will end up withpointerovernterover
as it just inserts the suggested text and doesn’t check anything for replacing
- Currently if you type
- When adding an xml namespace, don’t accept a completion on the ‘.’ character as it may complete on the wrong namespaces
- Allow hiding members/classes with
[EditorBrowsable]
Issue Analytics
- State:
- Created 9 months ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
IntelliSense in Visual Studio Code
VS Code IntelliSense offers different types of completions, including language server suggestions, snippets, and simple word based textual completions. Icon ...
Read more >IntelliSense in Visual Studio
IntelliSense is a code-completion aid that includes a number of features: List Members, Parameter Info, Quick Info, and Complete Word.
Read more >Type less, code more with IntelliCode completions
We hope you'll help us continue to improve by giving the newly enhanced completions a try and letting us know what you think....
Read more >IntelliSense in VS Code
The IntelliSense code editing feature in the ServiceNow Extensions for VS Code extension provides intelligent code completions which provide auto-completion ...
Read more >Auto Completions Speed Up in Java on Visual Studio Code
Speed improvements with the new server were said to boost all three phases of the code completion engine: searching the indexer to find ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It feels like at some point we will have to start using XamlX compiler for the XAML editor as well. For multiple reasons:
Possibly some const blob of bytes can be generated as an alternative, which is serialized by the compiler and deserialized by the previewer. Should save some size, but not too much as we still won’t be able to reuse key string values (which already exist in binary data section).