alefragnani / vscode-language-pascal

Pascal language extension for Visual Studio Code
MIT License
222 stars 47 forks source link

[BUG] - Continual WARNING popup for files out of source tree #125

Closed Quietus closed 1 year ago

Quietus commented 2 years ago

Environment/version

Steps to reproduce

  1. Use the pascal extension
  2. Create a project using git
  3. Create a new file, or edit an existing file while having your .vscode folder outside the source tree.

Result For editing a file: a popup stating "Some error occured: Warning: '/.vscode/GTEMP.pas' is out of source tree. ignored." with a Source of Pascal (Extension). For creating a new file: a popup stating "Some error occured: Warning: '/path/to/newfile.pas' is out of source tree. ignored." with a Source of Pascal (Extension).

I accept the extension needs me to add the files to the source tree - but the popup is unnecessary, a line in problems would do (and be less intrusive). This also seems new - I've been using your extension for a while and I don't remember this happening before the latest vscode updates.

alefragnani commented 1 year ago

Hi @Quietus ,

What do you mean about .vscode folder outside the source tree? Is it in the root folder of your project?

I mean, the .vscode folder is created and managed by VS Code, and is located in the project root. The Pascal extension uses this folder to store the GTEMP.pas temporary file, and this file is used by gtags and global to parse/generate the tags and provide you code navigation.

By the way, the message you see is generated by global, as global requires the source being analyzing to be within the project.

About the popup itself, I consider this message to be too important to be in the Problems panel, since it mean the extension itself is not working properly. A message in Problems should be for something that you could ignore. Anyway, feel free to open a separate Feature Request for this change, which could leave to the user decide which UI to be used to present such messages.

Hope this helps.

alefragnani commented 1 year ago

I'm closing this issue because no new comments has been added since my last question. Feel free to reopen/comment if the error still occurs.

Thanks for your understanding