volarjs / volar.js Goto Github PK
View Code? Open in Web Editor NEW๐๐
Home Page: https://volarjs.dev/
License: MIT License
๐๐
Home Page: https://volarjs.dev/
License: MIT License
In the following line, the language server attempts to search for all tsconfigs from the workspace root directory. If the user attempts to start vscode from the system root directory and opens a vue file, this could lead to performance issues for the language server searching through the entire file system for tsconfigs.
A better approach would be to attempt to search up for the tsconfig for each request.
The coc API is very similar to vscode, I think it is suitable to integrate it in the core.
I think this issue needs to be in language-tools, but that repo has limited issue reporting to existing contributors, so I can't post this there. If it does need to be moved, I would appreciate a contributor adding it over there. Thank you in advance!
I use VS Code for Vue development with the Volar plugins. In my VS Code config I used to use source.organizeImports
in editor.codeActionsOnSave
but it deletes unused imports which can break an application. I read that VS Code v1.57 added the source.sortImports
action for javascript and typescript files. However, this action has no effect on .vue files.
Please add source.sortImports
support for .vue files so I can automatically organize my inputs in a non-destructive manner.
Thank you!
Currently we have factory code for building commands in the following code, but it only works for VSCode (seems to work for coc too). We should judge the IDE of the language client to return the command format actually supported by the current IDE.
volar.js/packages/language-service/src/baseLanguageService.ts
Lines 129 to 197 in dfddd60
Hello there ! Thanks for making Volar, it is really awesome.
I want to implement server blocks for Nuxt nuxt/nuxt#20802
The SFC is going to look like this.
Under the hood, this entire block content would be removed, and processed separately by Nuxt. It wouldn't be present in the component itself, it's essentially isolated from blocks.
Adding lang="ts" make the color syntax work, but I want all the Typescript features to work, such as following the correct tsconfig and also typechecking.
I've considered using a <script server>
tag too, but it seems to be easier with a custom name.
What needs to happen with Volar to make something like this work ? I would appreciate if you could point me in the right direction.
Thanks !
Before:
volar.js/packages/language-service/src/types.ts
Lines 68 to 161 in b76317f
v1:
volar.js/packages/language-service/src/types.ts
Lines 77 to 125 in 3c85580
volar.config.js
has no effect on Windows because the language server fails to resolve the file path.
This happens because of the path
property on the URI class from vscode-uri
. On windows it returns /c:/path
instead of c:/path
.
The fix is to use fsPath
instead of path
when calling loadConfig
We've pretty much disassembled the shared module's functions down to the actual used packages, and we'll be able to remove it.
kit:
We need to refactor the architecture to reuse code to avoid possible inconsistent behavior.
Obviously there's no way to repro this in a repo, because this is an extension bug in VSCode, but on more than one occasion, if I'm working with a Vue SFC (in TypeScript), and I "Save as..." another file in the same folder, the script tag will say: Virtual script not found, may missing <script lang="ts"> / "allowJs": true / jsconfig.json
allowJs
is enabled and was working just fine in tsconfig.json. Creating a jsconfig.json
of course has no effect, because it's TypeScript (but I tried anyway). It happens only when duplicating a file. Restarting Volar is the only current fix.
vscode / builtin monaco will auto insert closing quotes / brackets, like typing (
will result in ()
with caret between it.
I doubt whether this feature related to @volar/monaco or @vue/repl itself
Hello,
Using NeoVim I have installed the volar
LSP via Mason
.
Now, when I edit a .vue
file, the volar LSP client immediately crashes with exit code 1 and signal 0.
This is the complete output in lsp.log
(I will split it in multiple lines for readability):
[START][2023-04-16 09:06:32] LSP logging initiated
[ERROR][2023-04-16 09:06:32] .../vim/lsp/rpc.lua:734 "rpc" "vue-language-server" "stderr"
"/home/vincent/.local/share/nvim/mason/packages/vue-language-server/node_modules/@volar/
vue-language-server/node_modules/@vscode/l10n/dist/main.js:846
throw new Error(e.responseText ?? (0, import_request_light.getErrorStatusDescription)(e.status) ?? e.toString());
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at /home/vincent/.local/share/nvim/mason/packages/vue-language-server/node_modules/@volar/
vue-language-server/node_modules/vscode-html-languageservice/lib/umd/parser/htmlScanner.js:17:18
at /home/vincent/.local/share/nvim/mason/packages/vue-language-server/node_modules/@volar/
vue-language-server/node_modules/vscode-html-languageservice/lib/umd/parser/htmlScanner.js:7:17
at Object.<anonymous> (/home/vincent/.local/share/nvim/mason/packages/vue-language-server/
node_modules/@volar/vue-language-server/node_modules/vscode-html-languageservice/lib/umd/parser/
htmlScanner.js:13:3)"
Is there a way for me to manually add dts files instead of having them auto-fetched?
Make core APIs completely based on uri
instead of fsPath
.
Currently Labs requires the entire @volar/langauge-server
module, which should be reduced to a protocol object.
It seems that vscode.env.openExternal cannot open files in remote (ssh). When I use vscode remote, there is no response when I click on it.
I need to find stats.html in os.tmpdir() and download it locally to open it. I am not familiar with vscode and do not know how to improve it.
Currently Monaco support is implemented by https://github.com/Kingwl/monaco-volar only for Vue, we should add a general package for Monaco support in this repo.
Ref: sublimelsp/LSP#2295
See screenshot. getProgram
is getting called infinitely recursively. This is happening when using vite-plugin-checker 0.5.6 with vue-tsc 1.1.7 and typescript 4.9.5, although I don't think its anything that vite-plugin-checker is doing wrong.
If it helps, the stack frame before the one selected in my screenshot, resolveNamesWithLocalCache
, is trying to call program.getResolvedProjectReferenceToRedirect('C:/my/project/__inferred type names__.ts')
on every single stack frame that that function is repeated.
We have now completed the Monaco integration and when I checked @vue/repl
I noticed it also uses another web code editor called CodeMirror, I was just considering whether it also needs LSP support.
The closest solution at the moment is codemirror-languageserver maintained by @hjr265.
But perhaps a compatibility package between Monaco worker and CodeMirror editor would be a better approach?
For now, I will keep this issue open but I may not do the work because I am not even sure if CodeMirror is still being used or maintained by the community.
Rules:
import type
for typescript/lib/tsserverlibrary
typescript/lib/tsserverlibrary
instead of typescript
Bug
Error: Debug Failure. False expression: y:/mapped_network_drive/path/to/project/node_modules/vue/dist/vue.d.ts linked to nonexistent file //server/linux/path/to/project/node_modules/vue/dist/vue.d.ts
Project Info:
Additional Infomation
[@volar-plugins/typescript] sourceFile not found file:///y%3A/path/to/project/app.vue.js
c:\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\typescript.js:39898
var item: Record<string, string> | undefined
var b= item?.name // => ?. is formatted correctly
var a= item?['name'] // => ?] is formatted as ternary operator instead (item ? ['name'])
Volar is not handling resolving external workspaces/packages within monorepo.
Reproduction: https://github.com/blake-newman/vue-tsc-import-resolution
When takeover mode is off it is able to auto import the modules/dependencies from external workspaces/packages
./packages/main/src/index.ts
try to use isFalse
function from b
package.
When takeover mode is on it is unable to auto import modules/dependencies from external workspaces/packages
./packages/main/src/index.ts
try to use isFalse
function from b
package.
<script setup lang="ts">
defineProps(['modelValue'])
defineEmits(['update:modelValue'])
</script>
<template>
<input :model-value="modelValue" @input="$emit('update:modelValue', $event.target?.value)">
</template>
for a component as simple as this, I am getting type errors from Volar (im in takeover mode and forced TS version to 4.9.5) saying that "Property value does not exist on type 'EventType'"
also using nuxt 3.3.2 if that matters
tried looking around and finding other solutions as well, any help is greatly appreciated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.