CoffeeChaton / vscode-autohotkey-NekoHelp-Old

my style
Other
9 stars 0 forks source link

Feature request: list all functions > limited to only opened file #19

Closed marius-sucan closed 1 year ago

marius-sucan commented 1 year ago

Hello!

The option to list all functions, lists all functions found in any associated file.

Please offer an option to only list the functions from the currently opened file.

Best regards, Marius.

CoffeeChaton commented 1 year ago

img

Is this what you mean?

It is not difficult to create this option, but it is easy to create different results by opening one less page and one more page. If you copy the file or move it to a different folder, opening another toolbar would be a simpler and more stable solution. I think this is XY problem. What do you really need? Is it easier to manage a large file by splitting it into multiple smaller files? Or are you trying to merge things from two different projects together, but you're having problems with the same function names?

Or do you just not need the project to scan certain folders or files?

"AhkNekoHelp.baseScan.IgnoredList": [
  "/\\.",
  ".vscode$",
  "/node_modules$",
  "/ahk_(?:lib|log|music)$",
  "/IMG$",
  "/src$"
]
marius-sucan commented 1 year ago

Good questions.

The situation is as follows.

I have my project folder with older files of the ahk file I'm working on. I also have library files.

Now, when I select list all functions, it parses all the files, including the older versions and the library files. That's why I asked if there's a way to limit it to the current/opened file.

Best regards, Marius.

CoffeeChaton commented 1 year ago

I can understand your needs

CoffeeChaton commented 1 year ago
  1. When the project starts, return the index file from the root directory of the workspace, and change the win-style path from "\" to "/" , this is to avoid multiple escaping semantics when writing rules. "\" in js is like ` in ahk
  2. Read the setting, and use new Regexp() to change form setting, and test whether it is passed item by item.
  3. When all the tests pass, the file will be added to the project index
  4. When the index construction is completed, it will be opened in the background of vscode to parse the file.

The reason I don't use .gitignore-style glob patterns is because it's 10x slower than pairing with an almost equivalent regexp

In short, if you want to exclude old folders or lib files, add the following some rules to the settings, and use command 1 to rebuild the project index.

    "AhkNekoHelp.baseScan.IgnoredList": [
        "/\\.", // Any folder/file starting with "." contains .git, .vscode, etc.
        "/node_modules$", // file-path Include node_modules
        "/node_modules/", // file-path Include node_modules
        // some demo
        "/neko_Exp_Gdip\\.ahk$",
        "/build(/|$)",
        "/dist(/|$)",
        "/temp(/|$)",
        "/ahk2(/|$)", // file-path Include /ahk2/
        "\\.2\\.ahk$", // file-path Include .2.ahk
        "/oldAhk(/|$)", // file-path Include oldAhk
        "/lib(/|$)" // file-path Include lib
    ],
marius-sucan commented 1 year ago

Thank you very much ! You can close the issue.

CoffeeChaton commented 1 year ago

i move to new repositories https://github.com/CoffeeChaton/vscode-autohotkey-NekoHelp-Old/issues/23