Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'await', 'async', 'dynamic' to CSharp #2413

Closed
olego opened this issue Oct 12, 2016 · 5 comments
Closed

Add 'await', 'async', 'dynamic' to CSharp #2413

olego opened this issue Oct 12, 2016 · 5 comments

Comments

@olego
Copy link

olego commented Oct 12, 2016

Description of the Issue

These 3 keywords are missing from C#: async, await, dynamic. Please add them to langs.xml

Steps to Reproduce the Issue

Open C# file, and write:

public async Task MyFunction()
{
dynamic var = await MyOtherFunction();
}

@dail8859
Copy link
Contributor

dail8859 commented Oct 12, 2016

According to the MSDN documentation they aren't actually reserved keywords. However it may not be a bad idea to add the contextual keywords anyways.

The C# lexer wouldn't be able to distinguish when the "contextual keywords" are applicable or not. Do you (or any one else familiar with C#) think this would be a problem? Meaning it would always highlight these contextual keywords.

@olego
Copy link
Author

olego commented Oct 12, 2016

I do a bit of C# programming, mostly in Visual Studio, but sometimes in
Notepad++ for quick edits. Of all the code I've been exposed to, I've
never seen anyone using contextual keywords as function or variable names.
Typically, the style is camelCased variables, almost always spelled out,
and almost always multi-word, so to answer your question, I don't think it
would be a problem to always highlight these contextual keywords.

I think I can also indicate the most frequently-used contextual words, in
order:

var await async
"yield return" "yield break"
where
dynamic

So even if you only add those, I'll be super-happy. By the way, "yield
break" and "yield return": does Notepad++ support keywords with spaces in
them? Unlike others, they are the only two that can't be rearranged.

On Tue, Oct 11, 2016 at 6:01 PM, dail8859 notifications@github.com wrote:

According to the MSDN documentation
https://msdn.microsoft.com/en-us/library/x53a06bb.aspx they aren't
actually reserved keywords. (Side note: there are quite a few other
keywords missing). However it may not be a bad idea to add them anyways.

The C# lexer wouldn't be able to distinguish when the "contextual
keywords" are applicable or not. Do you (or any one else familiar with C#)
think this would be a problem? Meaning it would always highlight these
contextual keywords.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2413 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABtfbNx8nntq5hIAJgux4vOa-xc1I7xRks5qzDFugaJpZM4KUOz7
.

@dail8859
Copy link
Contributor

I agree that it would most likely be rare to see these keywords elsewhere in code.

does Notepad++ support keywords with spaces in them?

Not it does not.

dail8859 added a commit to dail8859/notepad-plus-plus that referenced this issue Oct 12, 2016
@olego
Copy link
Author

olego commented Oct 12, 2016

Hooray! Many thanks!

On Wed, Oct 12, 2016 at 9:31 AM, dail8859 notifications@github.com wrote:

Closed #2413
#2413 via
addc9b4
addc9b4
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2413 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABtfbLHFAjNE9n4hzCDKyZZro2fv5zX8ks5qzQtjgaJpZM4KUOz7
.

@dail8859
Copy link
Contributor

Since these updates won't be available until the next release (and just in case you aren't aware), you can go ahead and add these yourself. Go to Settings > Style Configurator > C# > INSTRUCTION WORD and add them to the "User-defined keywords" on the right.

SinghRajenM pushed a commit to SinghRajenM/notepad-plus-plus that referenced this issue Nov 13, 2016
donho pushed a commit that referenced this issue Dec 26, 2023
Scintilla 5.4.1
https://www.scintilla.org/scintilla541.zip
Released 27 December 2023.

1.  Add IDocumentEditable interface to allow efficient interaction with document objects which may not be visible in a Scintilla instance. This feature is provisonal and may change before being declared stable. For better type-safety, the ScintillaCall C++ API uses IDocumentEditable* where void* was used before which may require changes to client code that uses document pointer APIs DocPointer, SetDocPointer, CreateDocument, AddRefDocument, and ReleaseDocument.
2.  Ctrl-click on a selection deselects it in multiple selection mode.
3.  Add SCI_SELECTIONFROMPOINT for modifying multiple selections.
4.  Add SCI_SETMOVEEXTENDSSELECTION and SCI_CHANGESELECTIONMODE to simplify selection mode manipulation.
5.  Improve performance of global replace by reducing cache invalidation overhead. [Feature #1502](https://sourceforge.net/p/scintilla/feature-requests/1502/).
6.  Fix regular expression search for "\<" matching beginning of search when not beginning of word and for "\>" not matching line end. [Bug #2157](https://sourceforge.net/p/scintilla/bugs/2157/).
7.  Fix regular expression search failure when search for "\<" followed by search for "\>". [Bug #2413](https://sourceforge.net/p/scintilla/bugs/2413/).
8.  Fix regular expression assertion (^, $, \b. \B) failures when using SCFIND_CXX11REGEX. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
9.  Fix regular expression bug in reverse direction where shortened match returned. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
10. Avoid character fragments in regular expression search results. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
11. With a document that does not have the SC_DOCUMENTOPTION_TEXT_LARGE option set, allocating more than 2G (calling SCI_ALLOCATE or similar) will now fail with SC_STATUS_FAILURE.
12. Protect SCI_REPLACETARGET, SCI_REPLACETARGETMINIMAL, and SCI_REPLACETARGETRE from application changing target in notification handlers. [Bug #2289](https://sourceforge.net/p/scintilla/bugs/2289/).

Lexilla 5.3.0
https://www.scintilla.org/lexilla530.zip
Released 27 December 2023.

1. Fix calling AddStaticLexerModule by defining as C++ instead of C which matches header. [Bug #2421](https://sourceforge.net/p/scintilla/bugs/2421/).
2. Bash: Fix shift operator << incorrectly recognized as here-doc. [Issue #215](ScintillaOrg/lexilla#215).
3. Bash: Fix termination of '${' with first unquoted '}' instead of nesting. [Issue #216](ScintillaOrg/lexilla#216).
4. HTML: JavaScript double-quoted strings may escape line end with '\'. [Issue #214](ScintillaOrg/lexilla#214).
5. Lua: recognize --- doc comments. Defined by [LDoc](https://github.com/lunarmodules/ldoc). Does not recognize --[[-- doc comments which seem less common.

Close #14375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants