godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.47k stars 148 forks source link

Fix project not found when `project.godot` file is excluded #635

Closed InfiniteXyy closed 2 months ago

InfiniteXyy commented 3 months ago

Fix a problem that when project.godot is excluded in VSCode, get_project_version function will always return undefined

How to reproduce:

  1. Add project.godot into vscode settings image
  2. Run open workspace with Godot Editor

There will be an error popup that the current workspace is not a godot project

There is a simple fix:

The findFiles api support taking a null value in the second parameter, then it will not take any exclusion from user config.

https://code.visualstudio.com/api/references/vscode-api

DaelonSuzuka commented 3 months ago

Why on earth would you want to exclude the extremely important project.godot?

InfiniteXyy commented 3 months ago

Why on earth would you want to exclude the extremely important project.godot?

Hello, when I first tried godot, I didn't know what project.godot did. I thought that it was a program-generated file.

Therefore, I excluded them and only keeps the gd files.

I did something wrong, but the plugin keeps reporting meaningless errors, and I don't know what happens.

I think it should be a bug, even the user exclude the project file, the plugin should read the hidden files (maybe for some personal preference or just because unfamiliar with Godot)

atirut-w commented 3 months ago

Wouldn't a better choice be disabling that popup with its explicitly excluded?

InfiniteXyy commented 3 months ago

In TypeScript project, when I exclude the tsconfig.json, the ts plugin is still able to detect and use that config file.

I think here files.exclude only means not showing in the tree structure

DaelonSuzuka commented 2 months ago

Thanks for submitting a fix for this, @InfiniteXyy.