-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
refactor(language-core): remove experimentalAdditionalLanguageModules
and deprecated APIs
#3907
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,53 @@ | ||
export * from '@volar/language-service'; | ||
export * from '@vue/language-core'; | ||
export * from './ideFeatures/nameCasing'; | ||
export * from './languageService'; | ||
export { TagNameCasing, AttrNameCasing } from './types'; | ||
export * from './types'; | ||
|
||
import type { ServiceEnvironment, ServicePlugin } from '@volar/language-service'; | ||
import type { VueCompilerOptions } from './types'; | ||
|
||
import { create as createEmmetServicePlugin } from 'volar-service-emmet'; | ||
import { create as createJsonServicePlugin } from 'volar-service-json'; | ||
import { create as createPugFormatServicePlugin } from 'volar-service-pug-beautify'; | ||
import { create as createTypeScriptTwoslashQueriesServicePlugin } from 'volar-service-typescript-twoslash-queries'; | ||
import { create as createCssServicePlugin } from './plugins/css'; | ||
import { create as createTypeScriptServicePlugin } from './plugins/typescript'; | ||
import { create as createVueAutoDotValueServicePlugin } from './plugins/vue-autoinsert-dotvalue'; | ||
import { create as createVueAutoWrapParenthesesServicePlugin } from './plugins/vue-autoinsert-parentheses'; | ||
import { create as createVueAutoAddSpaceServicePlugin } from './plugins/vue-autoinsert-space'; | ||
import { create as createVueReferencesCodeLensServicePlugin } from './plugins/vue-codelens-references'; | ||
import { create as createVueDirectiveCommentsServicePlugin } from './plugins/vue-directive-comments'; | ||
import { create as createVueDocumentDropServicePlugin } from './plugins/vue-document-drop'; | ||
import { create as createVueExtractFileServicePlugin } from './plugins/vue-extract-file'; | ||
import { create as createVueSfcServicePlugin } from './plugins/vue-sfc'; | ||
import { create as createVueTemplateServicePlugin } from './plugins/vue-template'; | ||
import { create as createVueToggleVBindServicePlugin } from './plugins/vue-toggle-v-bind-codeaction'; | ||
import { create as createVueTwoslashQueriesServicePlugin } from './plugins/vue-twoslash-queries'; | ||
import { create as createVueVisualizeHiddenCallbackParamServicePlugin } from './plugins/vue-visualize-hidden-callback-param'; | ||
|
||
export function createVueServicePlugins( | ||
ts: typeof import('typescript'), | ||
getVueOptions: (env: ServiceEnvironment) => VueCompilerOptions, | ||
): ServicePlugin[] { | ||
return [ | ||
createTypeScriptServicePlugin(ts, getVueOptions), | ||
createTypeScriptTwoslashQueriesServicePlugin(), | ||
createCssServicePlugin(), | ||
createPugFormatServicePlugin(), | ||
createJsonServicePlugin(), | ||
createVueTemplateServicePlugin('html', ts, getVueOptions), | ||
createVueTemplateServicePlugin('pug', ts, getVueOptions), | ||
createVueSfcServicePlugin(), | ||
createVueTwoslashQueriesServicePlugin(ts), | ||
createVueReferencesCodeLensServicePlugin(), | ||
createVueDocumentDropServicePlugin(ts), | ||
createVueAutoDotValueServicePlugin(ts), | ||
createVueAutoWrapParenthesesServicePlugin(ts), | ||
createVueAutoAddSpaceServicePlugin(), | ||
createVueVisualizeHiddenCallbackParamServicePlugin(), | ||
createVueDirectiveCommentsServicePlugin(), | ||
createVueExtractFileServicePlugin(ts), | ||
createVueToggleVBindServicePlugin(ts), | ||
createEmmetServicePlugin(), | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ServicePlugin, ServicePluginInstance } from '@volar/language-service'; | ||
import { create as baseCreate } from 'volar-service-css'; | ||
|
||
export function create(): ServicePlugin { | ||
const base = baseCreate({ scssDocumentSelector: ['scss', 'postcss'] }); | ||
return { | ||
...base, | ||
create(context): ServicePluginInstance { | ||
const baseInstance = base.create(context); | ||
return { | ||
...baseInstance, | ||
async provideDiagnostics(document, token) { | ||
let diagnostics = await baseInstance.provideDiagnostics?.(document, token) ?? []; | ||
if (document.languageId === 'postcss') { | ||
diagnostics = diagnostics.filter(diag => diag.code !== 'css-semicolonexpected'); | ||
diagnostics = diagnostics.filter(diag => diag.code !== 'css-ruleorselectorexpected'); | ||
diagnostics = diagnostics.filter(diag => diag.code !== 'unknownAtRules'); | ||
} | ||
return diagnostics; | ||
}, | ||
}; | ||
}, | ||
}; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If it's removed then the property should be removed instead of marked as deprecated IMO.
If the idea is that the link provides some info about removal then it's a wrong link.
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.
The purpose of marking it as deprecated is to be able to prompt warnings. I would remove the description, but I agree it would be better to have a deprecated message.
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've assumed that the schema uses
"additionalProperties": false
so that the removal would raise and error. But I see that it's not the case. I think that adding it would make sense so that this could be removed and also people would see issues if they mistype some option.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 couldn't get
"additionalProperties": false
to work, please feel free to open a PR if you get it to work.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.
additionalProperties
might not work if there are multiple schemas extending the same object but then my question is: do deprecated properties really need to be separated into its own file? If they wouldn't then it would be easy to useadditionalProperties: false
.BTW.
deprecated
is not a meant to be used for functionality that is removed but only for that that is still supported but discouraged. WithadditionalProperties:false
we could express both removed and deprecated properties.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 can confirm this works and implement by 777b0a1, thanks!