Error when attempting to deploy dnvm to use Omnisharp-atom in atom-editor

Asked 2 years ago, Updated 2 years ago, 101 views

I would like to know how to successfully plug OmniSharp-atom into atom.

We followed the instructions on the site below.

https://note.nkmk.me/c-sharp-mac-atom-omnisharp/

MONO installation completed successfully.

YUTA-no-MacBook-Pro:~YUTA$mono
Usage is:mono [options] program [program-options]

Development:
    --aot [=<options>] Compiles the assembly to native code
    -- debug [=<options>] Enable debugging support, use --help-debug for details
    -- debugger-agent = options Enable the debugger agent
    --profile [=profile] Runs in profiling mode with the specified profiler module
    --trace[=EXPR]Enable tracing, use --help-trace for details
    --jitmap Output a jit method map to /tmp/perf-PID.map
    --help-develop Shows more options available to developers

Runtime:
    --config FILE Loads FILE as the Mono config
    --verbose, -vIncreases the verbosity level
    --help, -h Show usage information
    --version, -V Show version information
    --runtime=VERSION Use the VERSION runtime, installed of autodetecting
    --optimize=OPT Turns on or off a specific optimization
                           Use --list-opt to get a list of optimizations
    --security [=mode]      Turns on the unsupported security manager (off by default)
                           mode is one of cas, core-clr, verifiable or validil
    -- attach = OPTIONS Pass OPTIONS to the attach agent in the runtime.
                           Currently the only supported option is 'disable'.
    --llvm, --nollvm Controls when the runtime uses LLVM to compile code.
    --gc=[sgen, boehm]      Select SGen or Boehm GC (runs mono or mono-sgen)
    --arch=[32,64]Select architecture (runs mono32 or mono64)
    --handlers Install custom handlers, use --help-handlers for details.
    --aot-path=PATH List of additional directories to search for AOT images.

However, the problem has surfaced.I'm trying to install dnvm from Homebrew.

YUTA-no-MacBook-Pro:~YUTA$brew install dnvm
Updating Homebrew...
==>Auto-updated Homebrew!
Updated 1tap (homebrew/core).
==>Updated Formulae
rancher-cli telegraf traffic

== > Installing dnvm from aspnet/dnx
== > Cloning https://github.com/aspnet/Home.git
Updating/Users/YUTA/Library/Caches/Homebrew/dnvm --git
==>Checking out branch dev
Error: No such file or directory - dnvm.sh

I would like you to give me detailed instructions on how to successfully plug OmniSharp-atom into atom from the time the problem was discovered.

After the problem was discovered, I referred to the following site.

As a result of reference,

1. Install NET Core SDK ver2.0.

*Page used for installation below
https://www.microsoft.com/net/learn/get-started/macos#macos

O Plug the Omnisharp-atom package into atom.

※Packages that can be installed from the atom editor.

一After finishing atom once and starting atom a few minutes later, the following warning was hopped up:

Failed to activate the omnisharp-atom package


atom.grammers.startIdForScope is not a function
Hide Stack Trace

TypeError: atom.grammers.startIdForScope is not a function
    at grammarCb(/Users/YUTA/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js: 145:35)
    at arrayEach (/Users/YUTA/.atom/packages/auto-encoding/node_modules/lodash/lodash.js:508:11)
    at forEach (/Users/YUTA/.atom/packages/auto-encoding/node_modules/lodash/lodash.js:9334:14)
    at OmniSharpAtom.activate (/Users/YUTA/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js: 153:30)
    at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:230:33)
    at measure(/Applications/Atom.app/Contents/Resources/app/src/package.js:206:33)
    at Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:88:25)
    activationPromise.Promise(/Applications/Atom.app/Contents/Resources/app/src/package.js:200:20)
    at Promise (<anonymous>)
    at Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js: 198:38)
    at PackageManager.activatePackage(/Applications/Atom.app/Contents/Resources/app/src/package-manager.js: 695:42)
    at packagesToEnable.forEach.name (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:440:51)
    at Array.forEach (native)
    at disabledPackagesSubscription.config.onDidChange(/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:440:30)
    atemitter.on (/Applications/Atom.app/Contents/Resources/app/src/config.js:1023:22)
    at Function.module.exports.Emitter.simpleDispatch(/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    atEmitter.module.exports.Emit(/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js: 141:34)
    at Config.emitChangeEvent(/Applications/Atom.app/Contents/Resources/app/src/config.js:1175:62)
    at Config.setRawValue (/Applications/Atom.app/Contents/Resources/app/src/config.js: 1008:23)
    at Config.set (/Applications/Atom.app/Contents/Resources/app/src/config.js:711:18)
    at Config.removeAtKeyPath(/Applications/Atom.app/Contents/Resources/app/src/config.js:901:16)
    at Package.enable (/Applications/Atom.app/Contents/Resources/app/src/package.js: 75:30)
    at PackageManager.enablePackage(/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:246:18)
    at HTMLButtonElement.enablementButtonClickHandler(/Applications/Atom.app/Contents/Resources/app/node_modules/settings-view/lib/package-card.js:362:31)

The error was brown from the omnisharp-atom package. This issue has already been reported.

As of March 18th - 22:00, we have performed the following tasks with reference to the following sites.

https://github.com/OmniSharp/omnisharp-atom/issues/1020

From koxu 1996 commented 5 days ago ~Simple solution~

ReReplace 140 line of omnisharp-atom.js from:
var grammers=atom.grammers;
to
var grammers=atom.grammers.textmateRegistry||atom.grammers;

一After finishing atom once and starting atom a few minutes later, the following two warnings were hopped up.

No.1.

Failed to load a language-csharp package grammar
atom.grammers.startIdForScope is not a function in/Applications/Atom.app/Contents/Resources/app.asar/node_modules/language-csharp/grammers/csx.json
Hide Stack Trace
TypeError: atom.grammers.startIdForScope is not a function
    at grammarCb(/Users/YUTA/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js: 145:35)
    at Function.module.exports.Emitter.simpleDispatch(/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    atEmitter.module.exports.Emit(/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js: 141:34)
    at GrammarRegistry.module.exports.GrammarRegistry.addGrammar(/Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar-registry.js:80:26)
    at Grammar.module.exports.Grammar.activate(/Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar.js:259:54)
    atgrammarRegistry.readGrammar(/Applications/Atom.app/Contents/Resources/app/src/package.js: 617:53)
    at CSON.readFile (/Applications/Atom.app/Contents/Resources/app/src/grammar-registry.js:468:15)
    atparseContents(/Applications/Atom.app/Contents/Resources/app/node_modules/season/lib/cson.js:123:13)
    at/Applications/Atom.app/Contents/Resources/app/node_modules/season/lib/cson.js:230:26
    at ELECTRON_ASAR.js:497:9
    at FSReqWrap.wrapper [asoncomplete] (fs.js:629:17)
   at/Applications/Atom.app/Contents/Resources/app.asar/node_modules/language-csharp/grammers/csx.json:1
The error was brown from the language-csharp package. This issue has already been reported.
View Issue

No.2.

Failed to load a language-csharp package grammar
atom.grammers.startIdForScope is not a function in/Applications/Atom.app/Contents/Resources/app.asar/node_modules/language-csharp/grammers/csharp.json
Hide Stack Trace
TypeError: atom.grammers.startIdForScope is not a function
    at grammarCb(/Users/YUTA/.atom/packages/omnisharp-atom/dist/omnisharp-atom.js: 145:35)
    at Function.module.exports.Emitter.simpleDispatch(/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    atEmitter.module.exports.Emit(/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js: 141:34)
    at GrammarRegistry.module.exports.GrammarRegistry.addGrammar(/Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar-registry.js:80:26)
    at Grammar.module.exports.Grammar.activate(/Applications/Atom.app/Contents/Resources/app/node_modules/first-mate/lib/grammar.js:259:54)
    atgrammarRegistry.readGrammar(/Applications/Atom.app/Contents/Resources/app/src/package.js: 617:53)
    at CSON.readFile (/Applications/Atom.app/Contents/Resources/app/src/grammar-registry.js:468:15)
    atparseContents(/Applications/Atom.app/Contents/Resources/app/node_modules/season/lib/cson.js:123:13)
    at/Applications/Atom.app/Contents/Resources/app/node_modules/season/lib/cson.js:230:26
    at ELECTRON_ASAR.js:497:9
    at FSReqWrap.wrapper [asoncomplete] (fs.js:629:17)
  at/Applications/Atom.app/Contents/Resources/app.asar/node_modules/language-csharp/grammers/csharp.json:1
The error was brown from the language-csharp package. This issue has already been reported.

PC: MacBook Pro (Retina, 13-inch, Early 2015)
OS: macOS Sierra ver 10.12.16

atom —Version 1.25.0 is the latest version.

Thank you to everyone who is involved in the editing.Thank you for your cooperation as long as you don't get tired.

.net atom-editor

2022-09-29 22:12

1 Answers

https://github.com/OmniSharp/omnisharp-atom/issues/1037#issuecomment-487233117

I changed two parts of omnisharp-atom.js to confirm normal operation.
I hope it will be helpful.

//var grammers=atom.grammers;
var grammers=atom.grammers.textmateRegistry||atom.grammers;
//atom.grammers.startIdForScope(grammar.scopeName);
grammar.startIdForScope(grammar.scopeName);


2022-09-29 22:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.