# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/.
# This module provides a backend for `clangd` in order to have support for # code completion, compile errors, go-to-definition and more. # It is based on `database.py` with the difference that we don't generate # an unified `compile_commands.json` but we generate a per file basis `command` in # `objdir/clangd/compile_commands.json`
import os
import mozpack.path as mozpath
from mozbuild.compilation.database import CompileDBBackend
def find_vscode_cmd(): import shutil import sys
# Try to look up the `code` binary on $PATH, and use it if present. This # should catch cases like being run from within a vscode-remote shell, # even if vscode itself is also installed on the remote host.
path = shutil.which("code") if path isnotNone: return [path]
cmd_and_path = []
# If the binary wasn't on $PATH, try to find it in a variety of other # well-known install locations based on the current platform. if sys.platform.startswith("darwin"):
cmd_and_path = [
{"path": "/usr/local/bin/code", "cmd": ["/usr/local/bin/code"]},
{ "path": "/Applications/Visual Studio Code.app", "cmd": ["open", "/Applications/Visual Studio Code.app", "--args"],
},
{ "path": "/Applications/Visual Studio Code - Insiders.app", "cmd": [ "open", "/Applications/Visual Studio Code - Insiders.app", "--args",
],
},
] elif sys.platform.startswith("win"): from pathlib import Path
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.