GithubHelp home page GithubHelp logo

cs-script.vscode's People

Contributors

dependabot[bot] avatar lbs-contributor avatar oleg-shilo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cs-script.vscode's Issues

Extension Stopped Working after "C# for Visual Studio" extension update

About two weeks ago, "C# for Visual Studio" was updated. Since then, I get the following error when loading a csharp file:

CS-Script: CS-Script: The required extension "C# for Visual Studio Code" is not found. Ensure it is installed.

The extension is installed. I tried uninstalling and reinstalling the C# extension, CS-Script, and VS Code itself with no luck.
Screenshot

How to get intellisense to work?

I followed the directions with no luck.

  1. Installed vscode
  2. Installed C# extension
  3. Installed Mono Debug
  4. Installed cs-script

I open my file...no intellisense.

Error: Specified file could not be executed. Could not load type 'System.IO.File' from assembly

CS-Script run script fails with this simple script:

using System.IO;

System.Console.WriteLine(File.Exists(""));

[Running] dotnet "C:\Users\JanMechtel\AppData\Roaming\Code\User\cs-script.user\dotnet\cscs.dll" "c:\Users\JanMechtel\new_script.cs"
Error: Specified file could not be executed.

Could not load type 'System.IO.File' from assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

[Done] exited with code=0 in 4.53 seconds

CS-Script run script after CS-Script: New C# script work fine.

I feel like it's releated to the .net version but I couldn't figure it out.

If I run the same script with css.exe it works fine.

CS-Script intellisense isn't working

Intellisense is not working for me, since no suggestion appears to autocomplete when putting something, I have tried what has occurred to me and I have read but it still does not work.

VSCode v1.44.1 (system setup)
VSCode Extension v1.6.4
CS-Script Engine v3.29.0

Using scriptcs instead of cscs

I use scriptcs because it allows to write scripts without basic using, main class and main static method.
The following code works without using, class or method:

Console.WriteLine("Hello");

As I like very much you extension, because it allows to code and debug in vscode, I would like also to use scriptcs with your extension.
Do you think there is any way to replace the call of cscs by scriptcs? And do you think the debugging feature still work?

mono C:\ProgramData\chocolatey\bin\scriptcs.exe .\script.cs

Load project does not open file

When I click "Load Project" on a CS-Script file, all I get is a new workspace with launch.json and tasks.json. Interestingly, if I go into the command pallete and click load project again it brings up the file I had open. However the file is still not open from within the workspace and thus OmniSharp is not being ran on the file.

"CS-Script is busy."

it isn't doing anything else it just throws that error at me

i'm on macOS and have tried restarting my computer

how can i fix this?

Make document formatting configurable

Based on #7:

Can you add an option to turn this (formatting) off? I use "C# FixFormat" to format, since it has some extra options I like. Having them both active messes up formatting of C# files.
Also, it seems like the CSS formatter is removing indentation on blank lines?

script debugging not working anymore

seems related to recent commit "- Added tunneling StartDebug request when workspace is loaded"

Now, trying ctrl+F5 just launches the .NET Core debugger and not Mono cs-script debugger anymore.
If I run the script with no .vscode folder, it prompts to create one & still wont start a mono based csscript debugger.

cscs command dont work with C#7

Issue Description

In the command console when I use the cscs command to execute some C# script, it appears to me that there is incompatibility with the "$" sign for string concatenation (this function was set in the C # 6 version), but when occupying the "CS-Script: Run in Terminal" button does work and there are no problems, so I don't know why I usually use the command console instead of the button.
Thank you for your attention, I hope you are well.

CS-Script Log

Error: Specified file could not be compiled.

csscript.CompilerException: c:\Users\Luck\Projects\Demo\Program.cs(10,31): error CS1056: Unexpected character '$'

at csscript.CSExecutor.ProcessCompilingResult(CompilerResults results, CompilerParameters compilerParams, ScriptParser parser, String scriptFileName,
String assemblyFileName, String[] additionalDependencies)
at csscript.CSExecutor.Compile(String scriptFileName)
at csscript.CSExecutor.ExecuteImpl()

Versions

VSCode v1.44.2 (system setup)
VSCode Extension v1.6.4
CS-Script Engine v3.29.0
.NET Core v3.1.2

Check syntax in scripts lacking Main method

Hi, Oleg.

I work with CS-Script in a hosted environment. I find it very usefult to check the scripts syntax beforehand. Otherwise, an exception will be thrown in time of execution.

But VSCode extension always shows 2 errors: the program does not contain any 'Main' static method as entrypoint (translated from spanish). Is there any means to 'inform' the extension: this is not a program, but a single script?

CSSConfig: searchDirs parameter not working.

Updates after 1.4.0 have affected the searchDirs parameter in Engine Settings. This parameter does not seem to be working in later releases. Direct references to the directories and objects need to be put in to bypass the issue.

Execute CS scripts on double-click

In explorer I associated the *.csx files to %APPDATA%\Code\User\cs-script.user\cscs.exe
But when I double-click on a *.csx file a console is displayed but disappears immediately.
Do you know how could I obtain the following behavior: double-click on a *.csx file opens a console, executes my cs script in it (allowing input read) and stays alive if I put a Console.ReadKey() in my cs script?

Version 1.6 Cannot create new script : mono required

OS version : Windows 10

Hi, First of all thank you for the plugin.

If mono is not installed it's not possible to use the plugin .

I have this error

CS-Script: Error: Command failed: mono --version 'mono' is not recognized as an internal or external command, operable program or batch file.

Cheers.

CS-Script for VS Code Portable

Ported from oleg-shilo/cs-script#165

I am using VS Code in portable mode, which places all user files and extensions under the the "VS Code Folder"/Data. Cs-Script does not recognize the portable installation and still installs updates under "User Folder"/AppData/Code/User. Is this an issue with VS Code or Cs-Script? Thanks in advance.

How to Run CSScript in VSCode using lastest Extension

How to Run CSScript in VSCode

20200215

Goals

  1. It's been a while, can't remember how to run it, and it does not look it wants to run
  2. Last used successfully in VSCode was around 20180517

Extensions Installed?

  1. It appears my VSCode has both of them

    image



    image


     


  2. The Toolbar appears as soon as I switch these particular .CS files,
    That's NICE !!!

    image

  3. But the Run button produces the following error:

    image

but CS-Script has External? Dependencies...Requirements...

  1. Back in 2018 for the first time in VSCode the Mono was
    The latest Stable Mono release is: 5.12.0 Stable (5.12.0.226)

    I am definitely behind...
     
  2. Download - Stable | Mono
    The latest Stable Mono release is: 6.8.0 Stable (6.8.0.105)

    image


  3. I downloaded mono-6.8.0.105-x64-0.msi Installed it

  4. No mention whether GTK version? is needed, I forgot what GTK stands for :)

  5. Verified
    C:\Program Files\Mono\bin\ is
    still on the path from previous setup....

    ECHO %PATH% >> TMP.TXT


    image


     

My real problem is probably CSCS.EXE is NOT on the path

  1. Searching C:\ reveals the following:

    image


     


  2. So which one should I use?


    1. C:\Users\AXM\AppData\Roaming\Code\User\cs-script.user



    2. C:\Users\AXM.vscode\extensions\oleg-shilo.cs-script-1.5.10\bin

       

    3. Why wasn't it installed? 

      Perhaps VSCode extension can't do that?





    4.  
  3. Computer Properties...

    image

User Variable

  1. It was set to:

    1. C:\PHP;C:\Ruby22-x64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Chocolatey\bin;C:\Users\AXM\AppData\Roaming\scriptcs;C:\Program Files\Microsoft VS Code\bin;C:\Users\AXM\AppData\Roaming\npm
  2. Replaced with:
    1. C:\PHP;C:\Ruby22-x64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Chocolatey\bin;C:\Users\AXM\AppData\Roaming\Code\User\cs-script.user;C:\Program Files\Microsoft VS Code\bin;C:\Users\AXM\AppData\Roaming\npm
  3. Then replaced with
    1. C:\PHP;C:\Ruby22-x64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Chocolatey\bin;C:\Users\AXM\.vscode\extensions\oleg-shilo.cs-script-1.5.10\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\AXM\AppData\Roaming\npm

System Variables

  1. It was set to:

    1. C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Program Files\Java\jdk1.7.0_03\bin;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\QuickTime\QTSystem\;%JAVA_HOME%\bin;%ADT_HOME%\tools;%ADT_HOME%\platform-tools;%ANT_HOME%\bin;%GIT_HOME%\cmd;C:\Program Files\Microsoft\Web Platform Installer\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Mono\bin;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd
  2. DID NOT TOUCH
  3. This is kind of a mess, I need an app to manage these vertically, one path per line

Seems like the Path fixed something but not quite CS-Script is still crashing...

  1. Check Syntax works
  2. I get to run once but with the following error

    image

  3. my main is practically empty.
     

INDEX 79

.END.
Something wrong with GitHub issues, pasting pictures fails to display some the pictures, instead
it displays the link only (preview and after posting) weird.
It takes several attempts then sometime it requires drag and drop .

Debugging does not work

I installed on Windows 10 Enterprise.
I installed the latest version of VS Code (1.41.1).
I installed CS-Script (v3.29.0) via chocolaty.
I installed Mono 6.8
I installed latest extension versions of "ms-vscode.mono-debug" (v0.15.8) and "ms-vscode.csharp" (v1.21.9) and "oleg-shilo.cs-script" (v1.5.10).
No I wrote a very simple script (see attachment, extension has to be renamed to *.cs)
Test.txt

And tried to debug with Alt+F5. the Debug console shows:
mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:33949 cscs.exe -d -inmem:0 -co:/debug:pdbonly -ac:2 c:\Temp\TestScripts\Test.cs

And after a few seconds (I translated it from german to english):
The command ""c:\Temp\TestScripts\mono.exe"" is either misspelled or
could not be found.

My path environment variable is pointing to the right directories:
PATH=C:\Program Files\Mono\bin;C:\ProgramData\chocolatey\lib\cs-script\tools\cs-script\lib;C:\ProgramData\chocolatey\lib\cs-script\tools\cs-script

What is wrong?

"mono" not found

Trying to use VSCode for csscript, but any command (debug, run, compile) outputs "Der Befehl "mono" ist entweder falsch geschrieben oder konnte nicht gefunden werden." (german, means "Command 'mono' is either wrong typed or cannot be found." / "Bad command or file name").
Any suggestion what can be wrong?
Using latest cs-script with latest VSCode (1.12.2) on german windows 7.

Will there be a cs-script.core.vscode ?

Are you planning on releasing a cs-script.core.vscode?

I already have dotnet core on my machine, installing mono for cs-script.vscode feels like overkill ;-)

throw "No process is associated with this object" on osx vscode

osx version 10.13.5
mono version 5.12.0

[Running] mono "/Users/wind/Library/Application Support/Code/User/cs-script.user/cscs.exe" "/Users/wind/Documents/test/Untitled-1.cs"
Error: Specified file could not be compiled.

System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x00018] in <81ba78c8dc794b7f9f7b530c53db0f84>:0
at System.Diagnostics.Process.get_HasExited () [0x0000b] in <81ba78c8dc794b7f9f7b530c53db0f84>:0
at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x0007b] in <81ba78c8dc794b7f9f7b530c53db0f84>:0
at System.Diagnostics.Process.get_ExitCode () [0x00000] in <81ba78c8dc794b7f9f7b530c53db0f84>:0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.get_ExitCode()
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler+MonoExecutor_patched.Local_InternalExecWaitWithCapture (System.String file, System.String cmd, System.String currentDir, System.CodeDom.Compiler.TempFileCollection tempFiles, System.String& outputName, System.String& errorName) [0x0011f] in <864b15734bd0484490a76fff76589a6c>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.Compile (System.CodeDom.Compiler.CompilerParameters options, System.String compilerFullPath, System.String arguments, System.String& outputFile, System.Int32& nativeReturnValue) [0x000e1] in <864b15734bd0484490a76fff76589a6c>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x001b8] in <864b15734bd0484490a76fff76589a6c>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x0005d] in <864b15734bd0484490a76fff76589a6c>:0
at csscript.CSExecutor.CompileAssembly (System.CodeDom.Compiler.ICodeCompiler compiler, System.CodeDom.Compiler.CompilerParameters compilerParams, System.String[] filesToCompile) [0x00000] in <8c9ac531470d4f7d8dc846a682dcb1ef>:0
at csscript.CSExecutor.Compile (System.String scriptFileName) [0x007d8] in <8c9ac531470d4f7d8dc846a682dcb1ef>:0
at csscript.CSExecutor.ExecuteImpl () [0x005a1] in <8c9ac531470d4f7d8dc846a682dcb1ef>:0

[Done] exited with code=1 in 0.445 seconds

Extension do not work

Dependencies are instaled but the extension doesn't work.
mono : The term 'mono' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • mono "C:\Users\mart\AppData\Roaming\Code\User\cs-script.user\cscs.exe ...
  •   + CategoryInfo          : ObjectNotFound: (mono:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

Auto-completion defect for nuget packages

It looks like intellisense in VS Code does not work for packages imported using //css_nuget directive.
For example with //css_nuget Newtonsoft.Json;, the intellisense does not work for types from this nuget.
I see it's referenced in the "CS-Script - Active" pane and the general C# intellisense from Omnisharp works OK.

Or maybe I have some configuration issues?

VS Code version:

Version: 1.61.0 (system setup)
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:11:57.396Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT ia32 10.0.19042

CS-Script version:

CS-Script.VSCode - v2.0.1
-------------------------------------------------------
C# Script execution engine (.NET Core). Version 4.1.0.0.
Copyright (C) 2004-2020 Oleg Shilo. www.csscript.net (github.com/oleg-shilo/cs-script.core)

   CLR:             5.0.10
   System:          Microsoft Windows NT 10.0.19042.0
   Architecture:    x64
   Install dir:     
   Script engine:   C:\Users\admin\AppData\Roaming\Code\User\cs-script.user\dotnet\cscs.dll
   Config file:     
   Compiler engine: dotnet (C:\Program Files\dotnet\dotnet.exe)
   NuGet manager:   dotnet
   NuGet cache:     C:\Users\admin\.nuget\packages
   Custom commands: C:\ProgramData\cs-script\commands
   Global includes: C:\ProgramData\cs-script\inc
-------------------------------------------------------
Syntaxer
   C:\Users\admin\AppData\Roaming\Code\User\cs-script.user\dotnet\syntaxer\syntaxer.dll
Extension
   c:\Users\admin\.vscode\extensions\oleg-shilo.cs-script-2.0.1\out

Mono needs to be in the path

...it's not enough for mono to be installed. It needs to be in the path or cs-script.vscode cannot find it. It would be nice for new users to add this to the documentation.

Cannot use //css_ref with brackets even with escape characters

I see this has been fixed in the main engine (oleg-shilo/cs-script#189) but I am still seeing this bug on the VS Code extension.

In my code that I am editing in VS Code, when I save with the line:
"//css_ref C:\Program Files ((x86))\Microsoft Office\Root\Office16\EXCEL.EXE"

the CS-Script pane in the Explorer shows no references.

When I delete the line and save, references appear.

Executing detached script (Ctrl+F5) work OK but sometimes trigger "is busy" warning message.

Is a cosmetic problem that does not affect functionality.
Caused by overly aggressive handling the race condition between "refresh_project_tree" triggered by saving the script document and the script already being executed.

The race condition is handled correctly but the message should not be shown in this case as tree refreshing is truly secondary with respect to the script execution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.