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.

Jump definition and onHover in emacs get an old location and information.

See original GitHub issue

First, I didn’t reproduce the problem in vscode, but in emacs when I register the workspace/didChangeWatchedFiles capability, I found the goto definition and onHover sometimes get an old information. After disabled the capability, it works as expect.

output-2022-03-25-21:48:48

Then I did some debugging to check what was done in onWorkspaceFilesChanged function. I found that it was caused by the following here. Is the if statement here reversed? Or there are other effects that can lead to this problem? https://github.com/johnsoncodehk/volar/blob/f00336e03717fb3a92b687739eb854d4f1ea4977/packages/vue-language-server/src/project.ts#L171-L176

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jadestrongcommented, Apr 5, 2022
2022-04-05 17:01:05 [24885] [vue-language-server projects.ts onDidChangeContent]
2022-04-05 17:01:05 [24885] [vue-language-server projects.ts onDidChangeContent]
2022-04-05 17:01:06 [24885] [vue-language-server projects.ts onDidChangeWatchedFiles]
2022-04-05 17:01:06 [24885] [languageFeatures onHover]
2022-04-05 17:01:06 [24885] [getValidTextDocument]
2022-04-05 17:01:06 [24885]
is oldDoc: file:///Users/jadestrong/Documents/JadeStrong/volar-starter/src/App.vue.ts
81218be79116cc15849d5a7322d1339ebb5611c12c982bcffff900e3a88d15c5
81218be79116cc15849d5a7322d1339ebb5611c12c982bcffff900e3a88d15c5

2022-04-05 17:01:06 [24885] [typescript-language-service hover.ts] doHover document]:
import { pageBack } from './hooks/useTest';
export default await (async () => {
const pageBack = () => {
}
return (await import('vue')).defineComponent({
setup() {
() => {
{
// @ts-ignore
() => { pageBack };
}
};
return { };
},
});
})();

I typed some logs. When I edited the file, the version of the file I got was the same, so it will not go to the getScriptSnapshot method in volar/packages/typescript-language-service/src/index.ts getTextDocument, and the document content returned here is also old.

image

0reactions
johnsoncodehkcommented, Sep 21, 2022

@jadestrong please let me know if still have this issue with v0.40.13 or later version, if so I will reopen issue and try to test with emacs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to jump back to previous position after check definition
Hi how can I jump back to previous position after check code's definition(SPC c d)? ... r/DoomEmacs icon Go to DoomEmacs.
Read more >
compile+.el - EmacsWiki
Some bindings that would normally ;; try to modify a compilation mode buffer are unbound, so they are ;; available for local (Compilation...
Read more >
In Emacs, how to go back to previous line position after using ...
Using C-c , j , I can go to the definition of the variable, but, how do I jump back to the previous...
Read more >
User Manual - rust-analyzer
The LSP allows various code editors, like VS Code, Emacs or Vim, to implement semantic features like completion or goto definition by talking...
Read more >
Literate .emacs.d | Data, Information, Knowledge - haakonhr
The older I get, the more I appreciate open-source and also free software. ... (use-package ace-jump-mode :config (define-key global-map (kbd "C-c C-SPC") ...
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