Git Product home page Git Product logo

cs-script.npp's People

Contributors

chcg avatar lbs-contributor avatar oleg-shilo avatar pawchen avatar taras-au 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  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  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  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

cs-script.npp's Issues

got alert in notepad++ 7.5.7

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)]

[Ctrl+Space] intellisense does not take additional non-GAC DefaultRefAsms into account

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.

"File could not be compiled" on macOS with dotnet core 2.2 and mono installed

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

Manual installation

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

Auto-completion is not working for a custom dll's object

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.

This ANSI plugin is not compatable with your Unicode Notepad++ v7.5.9 x32

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?

How do I connect the dll?

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.
01

I placed the library as shown in the picture.
MSACCESS_2021-07-06_22-47-38
02

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();		
		}		
	}
} 

cs-script.npp loads Microsoft.Build.Framework.dll from the wrong directory

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.

Error during startup of Notepad++ v7.5.7 x64

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:

grafik

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.

Compilation error

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).

Executing Code

The following issues have occurred since I upgraded cs script to version 1.7.6(The previous version I used was 1.7.4) :

  1. I can't debug my code(breakpoint has no effect)
  2. In the previous version, the output was displayed in the Notepad++ by pressing the F5 button but in this version is in console so when my code have an error i can't see result of exception

corrupted the code while saving

hi oleg-shilo
sometimes when I run the code or save the code(by pressing ctrl+s), the code file gets corrupted
like the video below:

ezgif com-video-to-gif

Fix variable name

In two cs source files, there is an extra "a" in "BindInteranalShortcuts"...
Isn't it ? :)

Cant Compile with Unsafe Code

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.

Cannot locate Roslyn compiler Path cannot be null

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.

Intercept StdOut for Build Output only.

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.

"Open in VS" button is not shown

Environment: Visual studio 2017 Professional, and notepad++ 7.5.7, and using cs-script plugin 1.7.14.0.

Steps to reproduce:

  1. Open a C# code file from notepad++
  2. Open project panel of cs-script

Result:
Cannot see the button "Open in VS" even "+openInVsBtn" is set in config file

Custom (F5) launcher with arguments

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.

Interesting project but could there be more examples

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!

Notepad++ new Plugin Admin under testing - maybe its worth to participate in the discussion

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.

How to enable unsafe code

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 ๐Ÿ‘

64 bit compatibility

Hi can you add 64 bit compatibility so I can run it with 64 bit edition of Notepad ++

How to Add missing `using` using hotkeys?

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.

  1. Am I doing everything right?
  2. How do I do this correctly?

[Question] Adapting the plugin to other programming languages

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.

Unable to Manually Install

Instructions for manual install are unclear. I have the .zip file with CSScriptNpp file folder and CSScriptNpp.dll. Where do I go from here to manually install the plug?
example

64-bit version

Any plans on 64-bit version? I'm using Notepad++ (64-bit) and was hoping to see CSScript.Npp work.

Auto-completion doesn't run the given css_precompiler first.

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).

can't create new project

I have a problem with creating a new project (bug in the attachment). I use Visula studio profesional 2015 and have installed cs-sscript by:
C: > choco install cs-script
bug

Exe path

Hi

where can I define the exe path

Support for debugging lambda expressions

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]} "

What is OemPeriod in hotkeys?

There is a position in the hotkeys:
Add missing 'using' - Ctrl+OemPeriod

What is OemPeriod?
How to implement OemPeriod?

Not compatible with current Version

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

using script config in notepad++ debugger not working

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.

The Debug panel does not open when you reopen it

Step -1. It works:

  • Notepad++ >> Plugins >> CS-script >> Debug Panel;
  • Result: Debug panel opened;

Step-2. Works:

  • I click [x] in the upper right corner of the Debug Panel to close the Debug Panel;
  • Result: The Debug Panel is closed;

Step-3. Problem!!!

  • Notepad++ >> Plugins >> CS-script >> Debug Panel;
  • Result: Debug Panel not opened; Problem !

Impossible to hide CS-Script's main panel

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.

Problems with NppAutomation in c# script

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()

Where are the "Script library" files?

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.

Format Document not using tab size of 3

Issue:

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.

System information:

Reproduction steps: https://www.screencast.com/t/2MnRTThoRigJ

  • Minimalist install, with Plugins Admin
  • Once installed: Settings -> Preferences -> Language -> [Default]
    • Tab size: 3
    • Replace by space: Checked
  • Ensure every language has "Use default value" checked (I only needed to fix this for python and yaml)
  • Close and reopen notepad++
  • Ensure the indent settings were preserved
  • Plugins -> Plugins Admin
    • Check "CS-Script - C# Intellisense" version "1.7.24"
    • Click Install, and let it restart notepad++
  • Notice the warning about auto-complete (https://github.com/oleg-shilo/cs-script.npp/wiki/Dealing-with-Notepad%E2%80%A0%E2%80%A0-native-auto-complete)
  • Settings -> Preferences -> Auto-Completion
    • Uncheck "Enable auto-completion on each input"
    • Uncheck "Function parameters hint on input"
  • Close and reopen notepad++
  • Ensure the indent settings were preserved
  • Type the following into a new file, and save to C:\temp\Test.cs
using System;

namespace Foo
{
class Bar
{
public static void main(String[] args)
{
Console.WriteLine("Press Enter to continue...");
Console.ReadLine();
}
}
}
  • Edit -> Select All
  • Plugins -> CS-Script -> Format Document
  • Notice it uses four spaces for indentation

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.