Skip to content

Scopes tokenizer: new implementation#5628

Draft
mkslanc wants to merge 7 commits intoajaxorg:masterfrom
mkslanc:scopes-tokenizer
Draft

Scopes tokenizer: new implementation#5628
mkslanc wants to merge 7 commits intoajaxorg:masterfrom
mkslanc:scopes-tokenizer

Conversation

@mkslanc
Copy link
Copy Markdown
Contributor

@mkslanc mkslanc commented Aug 20, 2024

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

Comment thread src/layer/text_util.js

exports.isTextToken = function(tokenType) {
return textTokens.has(tokenType);
return textTokens.has(tokenType.toString());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it simple_tokenizer is not working as expected

Comment thread src/mode/folding/mixed.js
if (typeof state != "string")
if (Array.isArray(state))
state = state[0];
for (var key in this.subModes) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add .syntax property to Scope to make this simpler?

Comment thread src/mode/lua_highlight_rules.js Outdated
onMatch2 : function(value, scope){
var parent = scope.get("bracketedComment" + (value.length - 2))
parent.meta = (value.length - 2);
return parent.get(this.next).get("comment");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use scope.get(this.next, value.length - 2).get("comment");

Comment thread src/mode/lua_highlight_rules.js
Comment thread src/mode/text.js Outdated
var pushState = function(currentState, stack) {
if (currentState != "start" || stack.length)
stack.unshift(this.nextState, currentState);
if (typeof currentState.get == "function") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep only the scope variant here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to make significant changes in normalizeRules logic in that case

Comment thread src/tooltip.js Outdated
Comment thread src/tokenizer.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants