-
Notifications
You must be signed in to change notification settings - Fork 57
CSS suggestions get dropped off when converting up into TypeScript completion items #132
Comments
I added some code actions to typescript-styled-plugin/src/_language-service.ts Lines 401 to 408 in f0e6997
|
Hey @aeschli, messaging you because it looks like you've dealt with this before. This means we're losing codeActions and commands coming up from CSS Language Service. Here (line 126) items have codeActions and Commands, but once they go through 137 all that has gone. |
The command that we add to the css completions is 'editor.action.triggerSuggest`. It opens code completion again after a proposal is applied. For example when a property is competed, the user can complete the values right away. I think you would have to convince the TypeScript guys to adopt the feature (at least a 'regtrigger' flag). Looking at the current API I don't see any tricks to achieve this. Even if there were, it would have to to be adopted in our TypeScript client. On the css side you can turn off the addition of command (document settings: |
@aeschli what's the reason TypeScript's language server interface have restricted
I wouldn't even know where to start in bringing that up as a feature request, It seems like the interfaces need adjusting and the TypeScript client would need changing to receive the commands? Maybe there's more to it than that.
Not sure I'm with you here, our issue is the command isn't happening at all, not that we want to turn it off. Do you mean once we've implemented it ourselves there would be conflicts? |
Commands on completions are quite an advanced feature, and is, to my knowledge, used only rarely. It's also not very clean as for this to work across editors it would require to define a set of known commands. Unfortunately TypeScript's API types and VSCodes API types are quite different for historical reasons. |
Closing as this package has been deprecated in favor of the official styled-components/typescript-styled-plugin fork After updating to that fork, follow up in the styled-components repo if this is still an issue |
Hi @mjbvz
I was looking into fixing the colon and semiColon auto completion which has been raised in styled-components
I came across completion items, which i assumed I can add a
command
property to, but it seems they're converted tocompletionEntry
s which seems to be a typescript thing.https://github.com/microsoft/typescript-styled-plugin/blob/main/src/_language-service.ts#L382-L395
CompletionEntry
s look similar toCompletionItem
s but don't have acommand
property (Im assuming they need to be generic).Do you know what's happening here? And does this make the above task not possible?
The text was updated successfully, but these errors were encountered: