We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This line collects the dependencies of a relative reference:
vscode-textmate/src/grammar.ts
Line 139 in 9157c7f
However, it passes in the patternRepository of the current rule.
patternRepository
collectSpecificDependencies then continues to use this patternRepository as new local context for resolving relative references.
collectSpecificDependencies
However, collectSpecificDependencies should continue with the repository of its own parents.
repository
Related: #174
The text was updated successfully, but these errors were encountered:
This test case fails:
test('Shadowed rules are resolved correctly ', async function () { const registry = new Registry({ loadGrammar: async () => undefined, onigLib: getOniguruma() }); try { const grammar = await registry.addGrammar({ scopeName: 'source.test', repository: { $base: undefined!, $self: undefined!, foo: { include: '#bar', }, bar: { match: 'bar1', name: 'outer' } }, patterns: [ { patterns: [{ include: '#foo' }], repository: { $base: undefined!, $self: undefined!, bar: { match: 'bar1', name: 'inner' } } }, { begin: 'begin', patterns: [{ include: '#foo' }], end: 'end' }, ] }); const result = grammar.tokenizeLine('bar1', null, undefined); assert.deepStrictEqual(result.tokens, [{ startIndex: 0, endIndex: 4, scopes: ["source.test", "outer"] }]); } finally { registry.dispose(); } });
Interestingly, this succeeds, because the earlier reference to foo causes it to bind to the correct bar:
foo
bar
test('Shadowed rules are resolved correctly ', async function () { const registry = new Registry({ loadGrammar: async () => undefined, onigLib: getOniguruma() }); try { const grammar = await registry.addGrammar({ scopeName: 'source.test', repository: { $base: undefined!, $self: undefined!, foo: { include: '#bar', }, bar: { match: 'bar1', name: 'outer' } }, patterns: [ { begin: 'begin', patterns: [{ include: '#foo' }], end: 'end' }, { patterns: [{ include: '#foo' }], repository: { $base: undefined!, $self: undefined!, bar: { match: 'bar1', name: 'inner' } } }, ] }); const result = grammar.tokenizeLine('bar1', null, undefined); assert.deepStrictEqual(result.tokens, [{ startIndex: 0, endIndex: 4, scopes: ["source.test", "outer"] }]); } finally { registry.dispose(); } });
Sorry, something went wrong.
include
captures
hediet
No branches or pull requests
This line collects the dependencies of a relative reference:
vscode-textmate/src/grammar.ts
Line 139 in 9157c7f
However, it passes in the
patternRepository
of the current rule.collectSpecificDependencies
then continues to use thispatternRepository
as new local context for resolving relative references.However,
collectSpecificDependencies
should continue with therepository
of its own parents.Related: #174
The text was updated successfully, but these errors were encountered: