pucelle / vscode-css-navigation

Allowing Go to definition from HTML to CSS, or Find References from CSS to HTML.
https://marketplace.visualstudio.com/items?itemName=pucelle.vscode-css-navigation
MIT License
64 stars 8 forks source link

CSS class completion in HTML replaces 1 extra char after class name #67

Closed Hippo0o closed 2 years ago

Hippo0o commented 2 years ago

in https://github.com/pucelle/vscode-css-navigation/blob/6f7d3a8a9daf116e4b91ff60f597a23ac9e4f3b8/server/src/server.ts#L301 and potentially https://github.com/pucelle/vscode-css-navigation/blob/6f7d3a8a9daf116e4b91ff60f597a23ac9e4f3b8/server/src/server.ts#L316 because the length of selector.raw.length includes the . or # but the inserted string doesn't have these chars, there is 1 extra char removed/replaced at the end. selector.raw.length --> selector.label.length that worked for me.

kanlukasz commented 2 years ago

I can confirm this issue too Here is example:

https://user-images.githubusercontent.com/30685349/159234516-5d2ad7dc-aeb6-4a23-9d75-29743b73a961.mp4

kanlukasz commented 2 years ago

This could be related to the fact that at the same time my virtual machine started using 90% of the CPU Especially when I open two VSCode instances with my projects (the add-on is active all the time). When I disable the add-on everything works fine

I remember a similar case with CPU with infinity loop here -> https://github.com/pucelle/vscode-css-navigation/issues/46#issuecomment-743178853.

pucelle commented 2 years ago

Will fix it soon.

pucelle commented 2 years ago

v1.13.3 released, fixed the "deleting one more char" issue.

I'm still debugging the "90% CPU" issue, but it's very hard, kanlukasz, can you provide more details about the issue, like:

  1. When it appears, when starting the workspace? or when doing a html or css completion?
  2. Does downgrade plugin version solve the issue? if so, which latest version is OK? You may also upgrade your codes that can reproduce the issue, thanks very much.
kanlukasz commented 2 years ago

Sorry for late reply.

I'm still debugging the "90% CPU" issue, but it's very hard

Yes, it will be very difficult or completely impossible as there are many dependencies along the way that could be the cause, incl. a virtual machine in the form of WSL2

1. When it appears, when starting the workspace? or when doing a html or css completion?

This happened when I was working in one workspace and opened an extra separate vscode window with another workspace (with a different project)

2. Does downgrade plugin version solve the issue? if so, which latest version is OK?

It is not possible to catch this issue at the moment so it is difficult to answer this question

Conclusion: I think that due to the lack of sufficient information on my part (which I am not able to provide at the moment) it will probably be better to close this issue. If this situation repeats, I will refer to this information in a new ticket

pucelle commented 2 years ago

@kanlukasz, Sure, thanks for your commands, Never mind to reopen this issue again.