Git Product home page Git Product logo

Comments (4)

pryrt avatar pryrt commented on July 29, 2024 1

the autoCompletion\cs.xml is a customizable configuration file; you can add any function completion you want to that file, and the next time you run Notepad++, those extra functions and parameters will be available for Function and Parameter Hint completion.

The user manual has a section on auto-completion. Please note the caveats on punctuation in auto-completion (your examples of Transform.rotation, for example).

from userdefinedlanguages.

pryrt avatar pryrt commented on July 29, 2024

There is no Unity3D C# UDL shared with this repository, nor have I ever seen one linked on the community.notepad-plus-plus.org forum.

However, If "Unity 3D C#" is really just C# syntax, with some extra keywords, then UDL might not be the best choice: it's probably easiest to just assign the Unity 3D C# extension to be interpreted as C#, and then add extra keywords to the C# lexer:

  1. Settings > Style Configurator: click Language: C#
  2. User ext.: = u3d or whatever the extension of "Unity 3D C#" is
  3. The Style: INSTRUCTION WORD and TYPE WORD both have User-defined keywords boxes, where you can add in all the extra keywords for the "Unity 3D" keyword extensions to C#

If you'd rather have different colors for the "Unity 3D" keywords as compared to "standard" C# keywords, the built-in lexer isn't enough. But adding the plugin EnhanceAnyLexer, you can define a [c#] section in the config file (Plugins > Enhance Any Lexer > Open Configuration File). For example, if you wanted these fake keywords unity3d and deunify to show up as cyan, and magenta and purple keywords to show up as a magenta color:

[c#]
0xFFFF00 = \b(unity3d|deunify)\b
0xFF00FF = \b(magenta|purple)\b

image

If you have more words for the same color, just continue adding them inside those parentheses with | between. If you want other colors for other keywords, just use similar lines . The left side of the equal-sign is a color; the right side is a regular expression (the same syntax that's allowed in Notepad++'s regular expression search; the ;-prefixed comments in the default config file for that plugin explains more about the color syntax.

from userdefinedlanguages.

zenhund74 avatar zenhund74 commented on July 29, 2024

Hello pryrt,

thank you for your quick and competent answer. Well the Unity 3D extension for C# is .cs so basically the default extension. I could add some more default keywords for Instruction Word and Type Word. But if e.g. I would add the type Transform I would not get auto-completion to offer me some properties like Transform.position or Transform.rotation. Would that be possible by editing the language file? Maybe I could copy the original file and add important classes with their properties and functions step by step?

Kind regards.

from userdefinedlanguages.

zenhund74 avatar zenhund74 commented on July 29, 2024

Thank you very much, I think I'll go for customizing the cs.xml. Ideal would be writing a script that goes through the Unity Scripting API and generates the xml file. For me this topic can be closed.

Kind regards.

from userdefinedlanguages.

Related Issues (20)

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.