-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix the ts version selected by the user #305
Changes from 6 commits
3e45be1
c9048cc
56ad8a2
b2591da
1f1b81d
b93dd55
9e686f0
0786e00
331b60e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ export function useStore( | |
vueVersion = ref(null), | ||
|
||
locale = ref(), | ||
typescriptVersion = ref('latest'), | ||
typescriptVersion = ref(null), | ||
dependencyVersion = ref(Object.create(null)), | ||
reloadLanguageTools = ref(), | ||
}: Partial<StoreState> = {}, | ||
|
@@ -270,6 +270,7 @@ export function useStore( | |
} | ||
} | ||
if (vueVersion.value) files._version = vueVersion.value | ||
if (typescriptVersion.value) files._tsVersion = typescriptVersion.value | ||
return '#' + utoa(JSON.stringify(files)) | ||
} | ||
const deserialize: ReplStore['deserialize'] = ( | ||
|
@@ -289,6 +290,8 @@ export function useStore( | |
for (const filename in saved) { | ||
if (filename === '_version') { | ||
vueVersion.value = saved[filename] | ||
} else if (filename === '_tsVersion') { | ||
typescriptVersion.value = saved[filename] | ||
} else { | ||
setFile(files.value, filename, saved[filename]) | ||
} | ||
|
@@ -431,7 +434,7 @@ export type StoreState = ToRefs<{ | |
|
||
// volar-related | ||
locale: string | undefined | ||
typescriptVersion: string | ||
typescriptVersion: string | null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type 'string | null' is not assignable to type 'string'. Perhaps the impact of this change would be minimal. // L273
if (typescriptVersion.value !== 'latest' || files._tsVersion) {
files._tsVersion = typescriptVersion.value
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgot to run the typecheck command to check. Thank you for your suggestion. I have already modified it.❤️ |
||
/** \{ dependencyName: version \} */ | ||
dependencyVersion: Record<string, string> | ||
reloadLanguageTools?: (() => void) | undefined | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I wonder if
typescriptVersion === latest
can be ignored ?By default, all data may have a
_tsVersion
file.But the default
vueVersion
is null.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if the ts version is not transmitted, request 404.
My latest submission has solved this problem.


It is similar to the writing of vue version request.