SuduIDE / ij-textmate

Support of language injection for Textmate bundles
MIT License
0 stars 0 forks source link

Incorrect completion contributor for the injected langauage #17

Open yeswolf opened 1 year ago

yeswolf commented 1 year ago

Looks like there is a keyword completion contributor for specific TM langauge, as it works in the separate file - we should use the same in the injected fragment instead of something general that's used now.

Correct:

Screenshot 2023-07-31 164609

Incorrect:

Screenshot 2023-07-31 164622

RazerFord commented 1 year ago

Corrected. Extracted tokens from regular expressions

image

yeswolf commented 1 year ago

I've tried HTML as an example and I see keywords that aren't from HTML bundle. Like - type 't' and have tamil suggested. Are we sure that when concrete language is selected only keywords from this language are here? Latest master.

Example:

        String html = "<p>some paragraph</p><i></i><t>";
RazerFord commented 1 year ago

To get keywords, I parse textmate regular expressions. They contain these side words. For example, tamil is found in the following regular expression for HTML:

(?xi) (?<![-])
        (arabic-indic | ... | tamil | ... | urdu)
        (?![-])

I see keywords from Java appeared in html

RazerFord commented 1 year ago

Corrected it so that words from other languages would not be present. Changed the way words are extracted. For some languages there were built-in keywords in IDE, I took them from there. For the rest I parsed regular expressions.

For HTML it looks like this. But words for it have to be extracted in a different way. image

However, there may still be words that are not keywords, but are contained in regular expressions. For example, there are languages here. image

It might be better to fill in keywords by hand. And if the user adds his textmate bundle, then provide UI for him to add keywords. What do you think?

RazerFord commented 1 year ago

I've merged