Document should be opened for completion
ryanvade opened this issue · 1 comments
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Steps to Reproduce
- Install IDE UI Packages (see HERE )
- Install ide-typescript
- Install language-vue
- Install ide-vue
- Type anything in a .vue file with typescript
Expected behavior:
I would expect to be able to use the IDE features.
Actual behavior:
I get the following errors:
TypeScript (Theia) rpc.sendRequest textDocument/completion threw ResponseError: Request textDocument/completion failed with message: The document should be opened for completion at handleResponse (/home/ryan/.atom/packages/ide-typescript/node_modules/vscode-jsonrpc/lib/main.js:436:48) at processMessageQueue (/home/ryan/.atom/packages/ide-typescript/node_modules/vscode-jsonrpc/lib/main.js:263:17) at Immediate.setImmediate (/home/ryan/.atom/packages/ide-typescript/node_modules/vscode-jsonrpc/lib/main.js:247:13) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5)
and
Uncaught (in promise) ResponseError: Request textDocument/completion failed with message: The document should be opened for completion at handleResponse (/home/ryan/.atom/packages/ide-typescript/node_modules/vscode-jsonrpc/lib/main.js:436:48) at processMessageQueue (/home/ryan/.atom/packages/ide-typescript/node_modules/vscode-jsonrpc/lib/main.js:263:17) at Immediate.setImmediate (/home/ryan/.atom/packages/ide-typescript/node_modules/vscode-jsonrpc/lib/main.js:247:13) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5)
Reproduces how often:
100% of time.
Versions
apm 2.1.7
npm 6.2.0
node 8.9.3 x64
atom 1.37.0
python 2.7.16
git 2.20.1
Ubuntu 19.04
Additional Information
This could very well be the interaction with ide-vue. But the error is thrown in ide-typescript sources.
I came here for same error, and I have found out that the error is from typescript-language-server/src/lsp-server.ts.
It is because the typescript language server opens the file on textDocument/didOpen
, but atom-languageclient
doesn't sends the method when the editor is turned on with files already opened.
TL;DR)
Close the opened tab and reopening might solve your issue.