oleg-shilo / cs-script.npp Goto Github PK
View Code? Open in Web Editor NEWCS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
License: MIT License
CS-Script (C# Intellisense) plugin for Notepad++ (x86/x64)
License: MIT License
got following alert dialog every time startup the notepad++ if installed cs-script(version 1.7.12.0).
This ANSI plugin is not compatible with your Unicode Notepad++.
CSScriptNpp.dll is not compatible with the current version of Notepad++.
Do you wnat to remove this plugin from the plugins directory to prevent this message from the next lunch?
[Yes(Y)] [No(N)]
Based on our email conversation:
I see. It is because the syntaxer (the intellisense engine) uses the script as a source of the ref assemblies but not the Npp config file. This does not affect intellisense for the GAC assembies (major objective of the def asms in the config) but does for non-GAC ones.
Would be nice if a future version of the plugin would support this.
MacOS X ,
Mono JIT compiler version 5.18.0.225
dotnet core 2.2
Editor -> VSCode / CommandLine
Not a single/simplest of files getting compiled
`
[Running] mono "/Users/psriva215/Library/Application Support/Code/User/cs-script.user/cscs.exe" "/Users/psriva215/Documents/Study/Cs/Program.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 <4605a50878ff458c98a8b66722729be6>:0
at System.Diagnostics.Process.get_HasExited () [0x0000b] in <4605a50878ff458c98a8b66722729be6>:0
at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x0007b] in <4605a50878ff458c98a8b66722729be6>:0
at System.Diagnostics.Process.get_ExitCode () [0x00000] in <4605a50878ff458c98a8b66722729be6>: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 :0
at csscript.CSExecutor.Compile (System.String scriptFileName) [0x007d8] in :0
at csscript.CSExecutor.ExecuteImpl () [0x005a1] in :0
[Done] exited with code=1 in 0.398 seconds
If it is possible please record a video about manual installation
I have a problem in add reference
When I use //CSS_ref sn.DLL
Output have an exception
Metadata was not found
However in panel added in reference
Hi,
I am trying to use my c# .NET dlls in my cs script and instantiating object for them. The problem I see is for one of my object, not able to see auto completion. For details in this page
As per the suggestion in the above link, I disabled autocompletion feature of notepad++ but still facing the same issue, it is even worse that auto completion is not working for local variables .
Thanks.
Hey folks.
So after the update of Notepad++ x32 from v7.5.8 to v7.5.9
CS Script plugin is failing to start (right at Notepad++ startup).
Error message is:
This ANSI plugin is not compatible with your Unicode Notepad++.
CSScriptNpp.dll is not compatible with the current version of Notepad++.
Do you want to remove this plugin from the plugins directory to prevent this message from the next launch?
I'm getting an error:
Error CS0433: Type 'Application2' exists in both 'Interop.Microsoft.Office.Interop.OneNote, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' and 'Microsoft.Office.Interop.OneNote, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.
I took the library from Visual Studio.
I placed the library as shown in the picture.
Code How_to_connect_dll_01.cs
//css_reference ../Folder_dll/Interop.Microsoft.Office.Interop.OneNote.dll
using System;
using Microsoft.Office.Interop.OneNote;
namespace Folder_NS_02
{
class Test
{
static void GetNamesAllBooksInClipboard2()
{
var onenoteApp = new Application2();
}
}
}
Here is the code:
//css_searchdir %ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
using System;
using Microsoft.Build.Framework;
public class Program
{
static public void Main(string[] args)
{
Console.WriteLine(typeof(IBuildEngine).Assembly.Location);
}
}
If this code is run by Notepad++ then output is:
C:\Program Files (x86)\Notepad++\plugins\CSScriptNpp\Roslyn\Microsoft.Build.Framework.dll
If this code is run by cscs.exe then output is correct:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Framework.dll
So CS-Script Plugin loads Microsoft.Build.Framework.dll from the incorrect directory.
Today I tested newest Notepad++ v7.5.7 x64. I ran it from a ZIP installation (with standard plugins only), installed x64 PluginManager and after that the CS-Script plugin (v1.7.11 from PluginManager's 64 bit plugin repository). At next startup Notepad++ shows the following error message:
I selected "No" (don't remove the plugin from plugins directory) and after startup of Notepad++ was completed the CS-Script plugin was present in Plugins menu and fully functional. The same happened after updating to CS-Script v1.7.12. But on the system where I did my tests there is even no 32 bit version of CS-Script plugin installed and also there is no CSScriptNpp.dll in the plugins directory (only a CSScriptNpp.x64.dll).
Under Notepad++ v7.5.6 x64 this error doesn't occur, so it seems like this would be a bug in Notepad++ v7.5.7. But further tests have shown that CS-Script is the only plugin (out of 23) which causes the error so I decided to report this bug here.
I just installed CS-Script(version: 1.7.8.0) on my notepad++(version: 7.5.4).When, I run any code this error occurs in the output panel:
Error: Specified file could not be compiled.
System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.TraceCompilerInput(String cmdLine)
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.Compile(CompilerParameters options, String compilerFullPath, String arguments, String& outputFile, Int32& nativeReturnValue)
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames)
at csscript.CSExecutor.CompileAssembly(ICodeCompiler compiler, CompilerParameters compilerParams, String[] filesToCompile)
at csscript.CSExecutor.Compile(String scriptFileName)
at csscript.CSExecutor.ExecuteImpl()
This didn't happen in my old version of Notepad++(plugin manager pre-installed) with my old version of CS-Script(Don't remember the version).
The following issues have occurred since I upgraded cs script to version 1.7.6(The previous version I used was 1.7.4) :
Moved from oleg-shilo/cs-script#116
It would be great if the -cd argument from the commandline version of cscs.exe were included in the GUI as well (and maybe all of the other commandline arguments too, if possible)
In two cs source files, there is an extra "a" in "BindInteranalShortcuts"...
Isn't it ? :)
I am trying to compile a project that needs to use the unsafe keyword. However the compiler is sending an error(CS0227) whenever I do. I looked this error up and it seems that the usual fix to this is to change a setting to allow unsafe to be used(if this was visual studio). However i don't see where I can change this in this plugin. Any help on getting this to work would be appreciated.
Based on bruderstein/nppPluginManager#52
It looks like the 1.7.1 work around is not reliable.
I am using version 1.7.14.0. I have the setting 'C# 7 support (Roslyn) - Requires .NET 4.6' unchecked. When I run a script, I get the Cannot locate Roslyn compiler Path cannot be null exception. I have attempted to fulfill the requirement in every way I can find, but nothing works. I see the CSSRoslynProvider.dll. When I try to upgrade the .NET Framework, it tells me that a newer version is already installed. This is Windows Server 2012 R2 Standard. It isn't the script, because it works on other servers and when you run it from Notepad++. I've seen this before and to fix it I copied the plugins folder from a working machine, but that didn't help this case. I uninstalled and reinstalled the plugin. Any suggestions would be great.
Hi,
Is it possibly to enable "intercept stdout" only for build?
If I developing console app, that use user input I must uncheck it, because "intercept" can't handle it, but if error occurs I must check it to see error message.
Environment: Visual studio 2017 Professional, and notepad++ 7.5.7, and using cs-script plugin 1.7.14.0.
Steps to reproduce:
Result:
Cannot see the button "Open in VS" even "+openInVsBtn" is set in config file
My application needs to be called like
"APP.exe" -s "%1"
where -s
identifies the next argument being a script
and "%1"
being a placeholder for the current document.
This is currently not supported by the [Custom (F5) launcher].
The call could also be "APP.exe" -s "%CurrDoc%"
or whatever placeholder concept is best suited.
In addition, I'd prefer the [Custom (F5) launcher] configuration show a tooltip or example telling me that I have to use quotes in case APP.exe
and/or %1
is located in a path containing spaces.
Hi
How do I set breakpoints?
Cannot seem to be able to add assembly references, particularly for Npp
automation features.
Chiefly I'm interested to do something basic to start with, like insert a time stamp.
I can do it in PythonScript
notwithstanding the x86 x64 installer confusion, but I'd like to get my feet wet doing this with CS Script.
Also, the Intellisense and/or auto-completion does not seem to pick up on these things. I see no options after obvious namespaces are entered. Does not add to the references, etc.
Thanks!
Since your CS-Script Notepad++ plugin is the most complex one I'm aware of, I want to point you to the ongoing discussion in the Notepad++ community forum about the newly introduced Npp Plugin Admin, see here. Further infos are obtainable here.
Currently Plugin Admin is under initial testing but it would bring some serious changes to plugins and would require some effort of plugin authors. Maybe its worth for you to participate in the discussion.
Hello
I am trying to use the unsafe code but it's have error CS0227 ("Unsafe code may only appear if compiling with /unsafe")
What is the purpose of this message?
What can I do?
csscript is perfect ๐
While using '.' or ctlr + space for auto-completion, please add functionality for automatically selecting the first occurance in "suggestion list" instead of pressing down arrow
Hi can you add 64 bit compatibility so I can run it with 64 bit edition of Notepad ++
I'm trying to add the missing using
with: Ctrl + .
, Alt + U
.
Nothing is happening.
I have a code
using System;
using System.Diagnostics;
namespace Folder_NS_02
{
public class Test
{
void Main(string[] args)
{
List<string> ItemsLst = new List<string>();
}
}
}
If I understand correctly, then after pressing Ctrl + .
, Alt + U
CS-script.npp
will add to the code the line using System.Collections.Generic;
.
I have nothing going on.
Questions.
It seems your plugin really improves Notepad++ a lot, for example by adding a true Intellisense feature.
I would like to ask if your plugin, with the proper work, could be adapted to support other programming languages. For example, C, C++, or even VHDL.
Great work, though.
Any plans on 64-bit version? I'm using Notepad++ (64-bit) and was hoping to see CSScript.Npp work.
I have noticed that if I have specified a precompiler via the css flag css_precompiler
and add some variables or usings there, they don't show up in the auto-completion.
It would be nice if there was the option to run some kind of precompiler before the auto-completion is generated.
In my particular case, I want to execute the script later in another program and want to emulate the environment of this program (like given imports and existing global variables).
Plaese add support for classname Auto-completion e.g:
typing "Con" shows the "Console" related classes as well as enums
Hi
where can I define the exe path
Please support for debugging lambda expressions, eg:
List<entity> lst = new List<entity>();
for (int i = 0; i < 10; i++)
{
lst.Add(new entity
{
a = i,
b = i*10,
c = i*100,
});
}
IEnumerable<entity> a = lst.Where(x => x.a > 5);
Current result for value of "a" is : " System.Linq.Enumerable+WhereListIterator`1[ConsoleApplication1.entity]} "
There is a position in the hotkeys:
Add missing 'using' - Ctrl+OemPeriod
What is OemPeriod
?
How to implement OemPeriod
?
Hi Oleg,
got the message "CSScriptNpp.X86.dll is not compatible with current Version of Notepad++"
This is the NPP Debug Info:
Notepad++ v7.5.6 (32-bit)
Build time : Mar 19 2018 - 00:26:59
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll
What can I do?
Josef
Debugging a script that is using a script config file .cs.config does not work, because the config file is not loaded. The debugger is always loading the C:\Program Files\Notepad++\plugins\CSScriptNpp\CSScriptNpp\css_dbg.exe.config which does not exists.
Why isn't it loading the script config file which is in the same directory as the script file?
In the C:\Program Files\Notepad++\plugins\CSScriptNpp\CSScriptNpp is no css_config.xml file. Can this be a problem?
I'm using notepad++ 7.6.6 (64bit) with CSScriptNpp 1.7.24
thanks for any help.
Step -1. It works:
Step-2. Works:
Step-3. Problem!!!
After CS-Script's main panel has switched to be visible it is not possible to switch it back to be invisible. Also the toolbar button doesn't reflect the panel's state, the toolbar button is always "Not pressed".
Npp version: 7.5.5 64-Bit
CS-Script version: 1.7.8.0 64-Bit
Same problem with 32-Bit versions. This bug was introduced around a year ago.
How do I enable snippets?
I'm having trouble creating a reference to NppAutomation.
Here's my code:
using System;
using System.Diagnostics;
using Npp=NppAutomation.Automation;
class Script
{
[STAThread]
static public void Main(string[] args)
{
Console.WriteLine("Hello World!");
Npp.OpenFile("blah");
Debug.WriteLine("Hello World!");
}
}
Error: Specified file could not be compiled.
C:\XXXXX\Documents\C# Scripts\CycleEncoding.cs(4,11): error CS0246: The type or namespace name 'NppAutomation' could not be found (are you missing a using directive or an assembly reference?)
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()
How do I add a library to References?
this is causing lag spikes while Im gaming is there a setting to stop the syntaxer.exe from connecting to the internet?
In the documentation on the website "cs-script.net" i found the section "Script library"
Where can I find the files that are described in cs-script/Lib, cs-script/Samples?
I use "cs-script" in Notepad++. I suspect that these files are used in other cases.
When formatting my C# file, it does not appear to properly get the indentation level I configured. It properly uses spaces instead of tabs, however it puts 4 spaces when all languages have 3 specified.
using System;
namespace Foo
{
class Bar
{
public static void main(String[] args)
{
Console.WriteLine("Press Enter to continue...");
Console.ReadLine();
}
}
}
Where is the main documentation page "cs-script.net"?
I have links to the pages
https://www.cs-script.net/cs-script/help-legacy/Adding_Searchdirs.html
https://www.cs-script.net/cs-script/help-legacy/Importing_scripts.html
and other pages.
Where is the main documentation page located cs-script.net
, where are the links to similar pages of the site
located?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.