File tree 2 files changed +16
-1
lines changed
packages/language-plugin-pug
test-workspace/tsc/passedFixtures/pug
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { SourceMap } from '@volar/source-map' ;
2
- import type { VueLanguagePlugin } from '@vue/language-core' ;
2
+ import type { CompilerDOM , VueLanguagePlugin } from '@vue/language-core' ;
3
3
import * as pug from 'volar-service-pug/lib/languageService' ;
4
4
5
+ const classRegex = / ^ c l a s s \s * = / ;
6
+
5
7
const plugin : VueLanguagePlugin = ( { modules } ) => {
6
8
7
9
return {
@@ -71,6 +73,13 @@ const plugin: VueLanguagePlugin = ({ modules }) => {
71
73
options ?. onWarn ?.( createProxyObject ( warning ) ) ;
72
74
} ,
73
75
onError ( error ) {
76
+ // #5099
77
+ if (
78
+ error . code === 2 satisfies CompilerDOM . ErrorCodes . DUPLICATE_ATTRIBUTE
79
+ && classRegex . test ( pugFile . htmlCode . slice ( error . loc ?. start . offset ) )
80
+ ) {
81
+ return ;
82
+ }
74
83
options ?. onError ?.( createProxyObject ( error ) ) ;
75
84
} ,
76
85
} ) ;
Original file line number Diff line number Diff line change
1
+ <template lang="pug">
2
+ div(
3
+ class ="foo"
4
+ class ="bar"
5
+ )
6
+ </template >
You can’t perform that action at this time.
0 commit comments