phptools-docs icon indicating copy to clipboard operation
phptools-docs copied to clipboard

No import suggestion or warning on pasted code using external namespace

Open mdusko opened this issue 8 months ago • 1 comments

Problem

When a class, function, or constant is pasted into a file using copy + paste, the extension does not recognize that an auto-import is needed — even when that option is enabled in the settings.

Additionally, there is no warning or indication that the entity being used is from an unimported namespace or module.

Expected Behavior

When pasting code that uses entities which are not yet imported, the extension should: 1. Automatically suggest the appropriate import, or 2. If configured to do so, automatically insert the import statement.

Current Behavior

There is no response — no auto-import, no suggestion, and no warning that the namespace is missing. This can lead to runtime errors that are not immediately obvious

Image

OS: Mac 15.4 Extension version: 1.57.17031

mdusko avatar Apr 11 '25 08:04 mdusko

May I ask the name of the setting for automatically importing types after paste?

There are warnings and suggestions for pasted code, if it's syntactically correct. If there are syntax errors after the paste, the user has to fix the errors first.

jakubmisek avatar Apr 18 '25 14:04 jakubmisek