cs-script icon indicating copy to clipboard operation
cs-script copied to clipboard

MyScript.$temp$.cs files created next to source (at least when installed from chocolatey)

Open rconde01 opened this issue 7 years ago • 6 comments

This is a new behavior from my perspective. This might not be tied to chocolately at all...but it's how i installed cs-script so it might be relevant. I'm getting these tmp files next to the source now which is not so nice in terms of source control. I could add a rule to the .gitignore, but I wanted to run it down with you before I went that route.

rconde01 avatar May 17 '18 17:05 rconde01

You are right this behavior has nothing to do with CS-Script being installed. In fact it is not even caused by CS-Script itself.

This temp file is created by CS-Script extension for VSCode or Notepad++:

  • https://github.com/oleg-shilo/cs-script.vscode/blob/12f807ee7a2779755a9dabd9de86d1b805a84370/src/utils.ts#L611-L622
  • https://github.com/oleg-shilo/cs-script.npp/blob/a9e489acd61290e87da17b46b06bee7ec75bd25d/src/CSScriptIntellisense/Syntaxer.cs#L229-L230

The temp file is create to allow Intellisense operations for unsaved C# files. The file is destroyed immediately after the Intellisense request is completed.

If it is consistently not the case please log an issue at https://github.com/oleg-shilo/cs-script.vscode. Or at https://github.com/oleg-shilo/cs-script.npp correspondingly.

If it can be reproduced then it can (and should) be fixed.

oleg-shilo avatar May 18 '18 00:05 oleg-shilo

BTW you are also right this is a relatively new behavior as it the support for intellisense for unsaved content has only been introduced in the latest releases of the VSCode and Npp plugins.

oleg-shilo avatar May 18 '18 00:05 oleg-shilo

So the context is VSCode. I need to look at it more closely...but i think it's maybe because I installed the cs-script extension, but I didn't install mono...VSCode has been yelling at me about that.

rconde01 avatar May 25 '18 15:05 rconde01

...but i think it's maybe because I installed the cs-script extension...

Yes, it is cs-script VSCode extension. It is exactly what I meant.


I changed this issue to "enhancement". I think there is a possibility for working with a temp copy of the script file placed in some hidden location. Though it's tricky as it it would require the script engine changes.

oleg-shilo avatar May 26 '18 08:05 oleg-shilo

Why not %TEMP%/Guid.cs ?

rconde01 avatar May 26 '18 10:05 rconde01

No, it does not matter what this dir is. What matters is that if you have a script c:\dev\script.cs and it imports script utils.cs from the same folder, then trying to have intellisense support for the %TEMP%/Guid.cs (having c:\dev\utils.cs unsaved content) will fail.

This is because the import statement //css_include utils.cs will trigger the attempt to find it in the %TEMP% dir instead of c:\dev.

This is what I meant "it's tricky".

oleg-shilo avatar May 26 '18 11:05 oleg-shilo