Git Product home page Git Product logo

language-csharp's People

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

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

language-csharp's Issues

Comments break highlighting of variable declaration in classes

As you can see public byte AltFormCount is highlighted correctly, wheres public byte FormPointer is not. This appears to be related to the comment, since it will be highlighted correctly when the comment is removed.

It is also noteworthy that this problem only occurs inside class definitions, but not inside methods.

screen shot 2015-08-13 at 18 16 43

Highlighting stops working halfway through a file

Hey, I'm coming here from GitHub Linguist repository after noticing an issue with highlighting in one of my files on GitHub.

Halfway through the file, the highlighting gets a bit messed up, where some keywords and names are no longer highlighted properly. Example (everything after the highlighted line is incorrect):

obrazek

and here is the file in question on my repository. Note that the file is syntactically valid and can be compiled without errors.


Also I noticed in another file (probably unrelated problem, let me know if I should make a separate issue for it) that extension methods are not highlighted correctly either, for example here, both 'this' and the name of the object should have a special color to be consistent with parameter highlighting elsewhere:

obrazek

Problems with colouring of types in items like Box<T>

If the function returns a generic then the css type is "span.meta.method.return-type.cs" (even for the type in the angle brackets). I believe that the item in the angle brackets (or the angle brackets should be a different type to help with reading.

For the parameter with footprint "SearchRequest searchRequest" the "SearchRequest" is of type "span.variable.parameter.function.cs" but the items in the angle brackets are the same colour as the parameter name and share all the same css.

Class modifiers are not being highlighted

I noticed this maybe within the past week or so (possibly earlier) on GitHub. Class modifiers don't highlight anymore:

public abstract class C { }

public sealed class C { }

C# - strings not highlighting correctly in classes

There's a weird glitch in highlighting strings. If you have a string within a class and that string has a { anywhere in it and there's anything before the string other than =, ignoring @, then the highlighting doesn't pick up the opening " and starts highlighting at the end of the string instead, making the rest of the code appear to be within a string. Here's a small example of what I mean:
error-example

It doesn't affect the program at all, but it gets really hard to read, especially if this happens at the top of the file.

Lack of Syntax Highlighting

Public static classes such as "Console.Writeline" are not highlighted at all, unlike the highlighting in my Xamarin IDE.

no syntax highlight
syntax highlight

Byte-order marker breaks highlighting of first line

I'm noticing that a lot of files that I'm opening (likely created by Visual Studio) aren't having their first line highlighted properly. Then, I finally noticed that if i place my cursor at the beginning of the file, and hit backspace, it fixes it. This revealed that there was a no-space character at the beginning of the file that was there, which I guessed was a Unicode BOM.

With BOM:
screen shot 2016-12-02 at 6 52 40 pm

Removed BOM:
screen shot 2016-12-02 at 6 57 15 pm

Investigation:
screen shot 2016-12-02 at 6 55 13 pm

This is probably a core issue, where Atom should detect utf-8 with BOM encoding (related: atom/atom#3427).

Indentation update mistake

I have my tab indentation set to 2 spaces.

Let's say I have this code:

public void foo() {
  var myVar = null;
}

If I add a line above it, when I hit semicolon the indentation jumps for both the initial and the new line

# About to hit semicolon
public void foo() {
  this.doStuff() # <- caret is after the bracket here
  var myVar= null;
}

# Just hit semicolon
public void foo() {
        this.doStuff(); # Just typed this semicolon
        var myVar = null;
}

As well as the indentation messing up, the caret jumps to an awful position several chars before var myvar.

Invalid code snipped for prop

  'Property':
    'prefix': 'prop'
    'body': '${1:string} ${2:PropertyName} { get; set; }'

Property is public so body should be like :

    'body': 'public ${1:string} ${2:PropertyName} { get; set; }'

Syntax highlighting for some new keywords

So I've grabbed this screenshot which includes some syntax I think could be done better:

screen shot 2014-02-28 at 1 53 13 pm

In particular:

  • const should be highlighted like void
  • async should be highlighted like void
  • Task should be highlighted like a type
  • the T in <T> should be highlighted like a type

#endif isn't treated as a preprocessor token

#if DEBUG
#endif

These are detected as:

if - span.meta.preprocessor.source.cs

DEBUG - span.entity.name.function.preprocessor.source.cs

endif - span.meta.method.body.source.cs

Incorrect hilite of numbers

Not all these are hilited as numbers

class Syntax
{
    public decimal decimal1 = 1.0m;
    //                        ^^^  constant.numeric.source.cs
    //                           ^ storage.type.numeric.cs
    public decimal decimal2 = 2.0M;
    //                        ^^^  constant.numeric.source.cs
    //                           ^ storage.type.numeric.cs
    public double double1 = 1.0d;
    //                      ^^^  constant.numeric.source.cs
    //                         ^ storage.type.numeric.cs
    public double double2 = 2.0D;
    //                      ^^^  constant.numeric.source.cs
    //                         ^ storage.type.numeric.cs
    public float float1 = 1.0f;
    //                    ^^^  constant.numeric.source.cs
    //                       ^ storage.type.numeric.cs
    public float float2 = 2.0F;
    //                    ^^^  constant.numeric.source.cs
    //                       ^ storage.type.numeric.cs
    public long long1 = 1l;
    //                  ^  constant.numeric.source.cs
    //                   ^ storage.type.numeric.cs
    public long long2 = 2L;
    //                  ^  constant.numeric.source.cs
    //                   ^ storage.type.numeric.cs
    public ulong ulong1 = 1ul;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong2 = 2UL;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong3 = 3lu;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong4 = 4LU;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong5 = 5uL;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong6 = 6Ul;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong7 = 7lU;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong ulong8 = 8Lu;
    //                    ^   constant.numeric.source.cs
    //                     ^^ storage.type.numeric.cs
    public ulong bad = 1UU;
    //                  ^^ - storage.type.numeric.cs
}

[C#] syntax coloring breaks down with interpolated strings

From @jumpinjackie on December 2, 2015 6:40

Using VSCode 0.10.3

The C# syntax coloring breaks down when interpolated strings are involved.

Example code

    namespace Test
    {
        public class Foo
        {
            static string AddTableName(string suffix) => $"Bar{suffix}_ADD";

            static string ModTableName(string suffix) => $"Bar{suffix}_MOD";

            static string DelTableName(string suffix) => $"Bar{suffix}_DEL";
        } 
    }

VSCode screenshot

capture

Copied from original issue: microsoft/vscode#900

Incorrect syntax highlighting for comments behind class definition

Prerequisites

I'm not actually using Aton, but rather found this issue through the Github syntax highlighter, which directed me here. As such some of the below doesn't quiet apply to my case and I've only done the points that seemed reasonable to me and removed the other ones from the list

Description

Comments are not highlighted correctly when they start behind the first line of a class definition that implements an interface.

Steps to Reproduce

  1. Copy paste this code
public class Test : ITest // Incorrectly highlighted
{}
public class Test2 // Correctly highlighted
{}

2 Check syntax highlighting

Expected behavior:
The comment on the first line should be highlighted in grey.

Actual behavior:
grafik

Reproduces how often:
Always

Versions

Not using Atom at all (see Prequisities). Happens on Github issues.

Unnecessary `source` scopes

In other languages there is no source scopes for languages symbols. I guess it might cause problems if packages would use scopes.

image

Dull highlighting

Hi,

this is the first time i opened C# files in atom and the syntax highlighting made it impossible for me to read 90% of the code is orange/ brownish.

checked different themes i'm on Seti / Base 16 Tomorrow dark. but it always is the same thing one color dominating the code.

is there something i should do ? is there anyway to contribute to this ?

image

Heads up on ongoing effort in VSCode C# grammar and can we unify the two grammars?

Hi,

There have been some substantial improvements to the C# grammar in the VSCode repo (here) and ongoing effort to build out the test coverage (here)

As such I wanted to raise your attention to this issue here: dotnet/vscode-csharp#877 :

Appears to me that there is some ongoing duplicated effort with the C# textmate grammar in VSCode (gitlog) and Atom (gitlog).

Seems like the only real difference between the two is JSON vs CSON, so why not extract the VSCode textmate C# grammar and test harness setup into a separate repo in OmniSharp, port any fixes from Atom and then share the same grammar across the two extensions (outping CSON, etc)?

Generic Parameters break method signature parsing

Notice how method names with Generic parameters aren't parsed as entity.name.function.cs. You can tell because Register<TEvent> has no style applied.

Also, Generic parameters aren't recognized in method return-types.

broken method signatures

sample code:

        // Broken
        public IDisposable Register<TEvent, THandler>()
            where TEvent : IEvent
            where THandler : IEventHandler<TEvent>, new()
        {
        }

        // OK
        public IDisposable Register(Type eventType, IEventHandler handler)
        {
        }

        // Broken
        public IDisposable Register<TEvent>(IEventHandlerFactory handlerFactory) where TEvent : IEvent
        {
        }

        // Returntype broken
        public IDisposable<TEvent, TBar> Register(Type eventType, IEventHandlerFactory handlerFactory)
        {
        }

Additional classes/parsing

Hi, I maintain an Atom Theme and there's a couple things I'd like to add styling for in C#, however the parsing doesn't seem to be adding the appropriate classes. The cases I've noticed so far are:

  • parentheses on if statements and method definitions are not classed, though method call parens are (they get .punctuation.definition). Javascript classes them as .meta.brace.round, maybe C# could do something similar?
  • Operators do not appear to get broken out at all. In most other languages I've worked on operators will have the .operator class.

image

Support for expression-bodied members in C# 6

Noticed this while updating the README of one of my own repos. This code does not highlight correctly:

public class MyCollection<T> : IEnumerable<T>
{
    private T[] array;

    public StructEnumerator<T> GetEnumerator() =>
        Enumerator.Struct(array);

    IEnumerator<T> IEnumerable<T>.GetEnumerator() =>
        Enumerator.Class(array); // avoid boxing of value types

    IEnumerator IEnumerable.GetEnumerator() =>
        this.GetEnumerator();
}

Not quite sure how to fix this, but I thought I'd just check in and let you guys know.

Nested namespaces are not highlighted

Nested namespaces are not highlighted correctly.

screen shot 2015-10-03 at 17 46 59

Example code:

using System;

namespace ECS {
    namespace Exceptions {
        public class ComponentAlreadyPresentException : Exception {

        }
    }
}

Looks like GitHub's syntax highlighter doesn't support them either.

Supporting `using static` in C# 6

This code does not syntax highlight correctly:

using static System.Console;

The static keyword should be recognized outside of its place as a storage modifier.

`using` recognition?

Hi, not sure if this is an issue for you or not, if it's in some other package feel free to send me on.

I've noticed a problem with the using statement on the first line of a file. There seems to be some sort of non-printing character there; hitting backspace removes it and fixes this issue. my guess would be a byte-order mark? So far this seems to happen in any C# file created in Visual Studio.

image

Not working

I am not able to use the c# plugin in my editor even though i have this package in my editor.

First "uses" have wrong color

I used the Atom Dark Fusion Theme and the coloring on the first line "Using ..." will get wrong. All extra using has normal syntax color, it's just the first line.

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.