Skip to content
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

code completion ignore words in comment and string #553

Closed
VoilierBleu opened this issue Nov 26, 2022 · 10 comments
Closed

code completion ignore words in comment and string #553

VoilierBleu opened this issue Nov 26, 2022 · 10 comments

Comments

@VoilierBleu
Copy link
Contributor

while coding in VBS, the completion function scan each word in my comments and give them as proprosal, it's really irrelevant. why not the possibility to choose one or many external files that the dev could control ? So only correct proprosals could be made ?

@zufuliu
Copy link
Owner

zufuliu commented Dec 7, 2022

Using external API file is duplicate of #59.

VB and VBS need changed generate keywords from external API files.

"scan each word in my comments and give them as proprosal" can be fixed by adding SCE_B_COMMENT into ignore_word_style in lexer configuration for VBS:

https://github.com/zufuliu/notepad2/blob/6afcad5a4ac5e17f03bae14420a6e837c059a9f1/tools/LexerConfig.py#L790-L797

@zufuliu
Copy link
Owner

zufuliu commented Dec 7, 2022

Add new option "Scanning words in comment." seems would be a better approach, words in comment will be ignore when the option is unchecked and typing outside comment, typing inside comment will still scan whole document. Similar option "Scanning words in string." can be added too, implementation is easy with following pseudo code:

if (not bScanWordsInComment and not IsCommentStyle(currentStyle)) {
    // add comment styles into ignored style list
}
if (not bScanWordsInString and not IsStringStyle(currentStyle)) {
    // add string styles into ignored style list
}

@VoilierBleu
Copy link
Contributor Author

OK. But what's the point with scanning comment ? Why scanning them ? They are usually explanations for the dev, not keywords, correct ?

@zufuliu zufuliu changed the title Use code completion with a list of words from a file code completion ignore words in comment and string Dec 8, 2022
@zufuliu
Copy link
Owner

zufuliu commented Dec 8, 2022

what's the point with scanning comment ?

Possible to find identifiers in code sample inside comment? not finding words inside comment might be behavior change for non-programming source file (configuration file, YAML, etc.).

@zufuliu zufuliu added 🌐i18n Localization/Internationalization ui labels Jan 6, 2023
@zufuliu
Copy link
Owner

zufuliu commented Jan 6, 2023

I think we can add following options ("Plain Text" is used for #338) to custom auto-completion:
auto-completion

@VoilierBleu
Copy link
Contributor Author

VoilierBleu commented Jan 6, 2023 via email

@zufuliu zufuliu modified the milestones: v4.23.03, v4.23.05 Feb 27, 2023
@zufuliu zufuliu modified the milestones: v4.23.04, v4.23.06 Apr 9, 2023
@zufuliu
Copy link
Owner

zufuliu commented May 7, 2023

This option is added (not yet implemented).
image

@VoilierBleu
Copy link
Contributor Author

One foot after the other ! :)

@zufuliu
Copy link
Owner

zufuliu commented May 10, 2023

The two "Comment" options are implemented, feel free to test latest builds (e.g. from https://github.com/zufuliu/notepad2/actions/runs/4937266158).

@zufuliu
Copy link
Owner

zufuliu commented May 20, 2023

This feature is full implemented now.

@zufuliu zufuliu closed this as completed Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants