All Projects → emacs-csharp → Csharp Mode

emacs-csharp / Csharp Mode

Licence: gpl-3.0
A major-mode for editing C# in emacs

Projects that are alternatives of or similar to Csharp Mode

Yii2 Jui
Yii 2 JQuery UI extension.
Stars: ✭ 120 (-0.83%)
Mutual labels:  hacktoberfest
Youtubedownloader
Downloads videos and playlists from YouTube
Stars: ✭ 2,202 (+1719.83%)
Mutual labels:  hacktoberfest
Hubspot3
python3.5+ hubspot client based on hapipy, but modified to use the newer endpoints and non-legacy python
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Mdx Embed
Embed 3rd party media content in MDX - no import required 🧽
Stars: ✭ 119 (-1.65%)
Mutual labels:  hacktoberfest
Docs
📚 Documentation for 🚀 Fiber
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Cyclotron
A web platform for constructing dashboards.
Stars: ✭ 1,554 (+1184.3%)
Mutual labels:  hacktoberfest
Vscode Verilog Hdl Support
Verilog HDL/SystemVerilog/Bluespec SystemVerilog support for VS Code
Stars: ✭ 120 (-0.83%)
Mutual labels:  hacktoberfest
Geoext3
A JavaScript framework that combines the GIS functionality of OpenLayers with all features of the ExtJS library
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Ralph
Ralph is the CMDB / Asset Management system for data center and back office hardware.
Stars: ✭ 1,701 (+1305.79%)
Mutual labels:  hacktoberfest
Spectre.cli
An extremely opinionated command-line parser.
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Apple cursor
🍎 macOS Cursor Theme
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Netcoreblockly
.NET Core API to Blockly - generate from WebAPI, Swagger, OData, GraphQL =>
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Pyms
Library of utils to create REST Python Microservices
Stars: ✭ 120 (-0.83%)
Mutual labels:  hacktoberfest
Minify
Minifier of js, css, html and img
Stars: ✭ 120 (-0.83%)
Mutual labels:  hacktoberfest
Mapswipe
MapSwipe mobile application
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Client
Stars: ✭ 120 (-0.83%)
Mutual labels:  hacktoberfest
Docs Cn
TiDB/TiKV/PD documentation in Chinese.
Stars: ✭ 1,646 (+1260.33%)
Mutual labels:  hacktoberfest
Downlords Faf Client
Official client for Forged Alliance Forever
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
Csp Auditor
Burp and ZAP plugin to analyse Content-Security-Policy headers or generate template CSP configuration from crawling a Website
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest
React Kanban Dnd
📋 Open source kanban board built with React
Stars: ✭ 121 (+0%)
Mutual labels:  hacktoberfest

[[https://github.com/emacs-csharp/csharp-mode/actions][file:https://github.com/emacs-csharp/csharp-mode/workflows/Build%20&%20Test/badge.svg?branch=master]] [[https://melpa.org/#/csharp-mode][file:https://melpa.org/packages/csharp-mode-badge.svg]] [[https://stable.melpa.org/#/csharp-mode][file:https://stable.melpa.org/packages/csharp-mode-badge.svg]]

  • csharp-mode

This is a mode for editing C# in emacs. It's using [[https://github.com/ubolonton/emacs-tree-sitter][tree-sitter]] for highlighting and indentation. ** Main features

  • font-lock and indent of C# syntax including:
    • all c# keywords and major syntax
    • attributes that decorate methods, classes, fields, properties
    • enum types
    • #if/#endif #region/#endregion
    • instance initializers
    • anonymous functions and methods
    • verbatim literal strings (those that begin with @)
    • generics
  • intelligent insertion of matched pairs of curly braces.
  • compilation-mode support for msbuild, devenv and xbuild.

** tree-sitter support You can enable experimental tree sitter support for indentation and highlighting using #+begin_src elisp (use-package tree-sitter :ensure t) (use-package tree-sitter-langs :ensure t)

(use-package csharp-mode :ensure t :config (add-to-list 'auto-mode-alist '("\.cs\'" . csharp-tree-sitter-mode))) #+end_src If you are using this, clearly state so if you find any issues.

Note that we don't depend on tree-sitter yet, so you have to manually install the packages involved. The simplest way is to use the provided snippet above.

*** Using and evolving the tree-sitter functionality. =tree-sitter= introduces a minor mode called =tree-sitter-debug-mode= where you can look at the actual syntax tree it produces. If and when you spot missing or wrong syntax highlighting, look at how the patterns are written in =csharp-tree-sitter-mode.el=, then submit a pr with a couple new ones added. When testing and debugging this, it is actually as simple as =M-x eval-buffer= on =csharp-tree-sitter-mode.el=, then =M-x revert-buffer= in the file you are testing. It should update and show the correct syntax highlighting.

So the development cycle is:

  • Spot missing syntax highlighting
  • View AST with =tree-sitter-debug-mode=
  • Locate offending part
  • Add new pattern
  • =M-x eval-buffer= in =csharp-tree-sitter-mode.el=
  • =M-x revert-buffer= inside your =some-test-file.cs=

** Usage

This package is currently available on MELPA. Install using M-x package-installcsharp-mode.

Once installed the package should be automatically used for files with a '.cs'-extension.

Note: This package is also available on [[http://stable.melpa.org/][MELPA-stable]] for those who don't want or need bleeding edge development-versions.

For a better experience you may want to enable electric-pair-mode when editing C#-files. To do so, add the following to your .emacs-file:

#+BEGIN_SRC emacs-lisp (defun my-csharp-mode-hook () ;; enable the stuff you want for C# here (electric-pair-mode 1) ;; Emacs 24 (electric-pair-local-mode 1) ;; Emacs 25 ) (add-hook 'csharp-mode-hook 'my-csharp-mode-hook) #+END_SRC

For further mode-specific customization, M-x customize-group RET csharp RET will show available settings with documentation.

For more advanced and IDE-like functionality we recommend using csharp-mode together with [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]] or [[https://github.com/joaotavora/eglot][eglot]]

  • Attribution

This repo was a fork of the code originally developed by Dylan R. E. Moonfire and further maintained by Dino Chiesa as hosted on [[https://code.google.com/p/csharpmode/][Google code]].

** New focus

The original csharp-mode repo contained lots of different code for lots of different purposes, some finished, some not, some experimental, some not. Basiaclly things like ASPX-mode, TFS-mode, code completion backends, etc.

All this original code can still be found in the [[https://github.com/josteink/csharp-mode/tree/extras][extras-branch]], but we have decided to go for a more focused approach and to throw out all dead or unused code, code we wont be maintaining.

The goal: That what we package in csharp-mode actually works and works well.

  • License

The original project was licensed under [[https://www.gnu.org/licenses/gpl-2.0.html][GPL v2]], but after rewrite in September 2020, it is relicensed to GPLv3

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].