更新结构
This commit is contained in:
parent
2b455a838d
commit
00ec7abc6c
@ -1,20 +1,10 @@
|
|||||||
use crate::server::ProjectConfig;
|
use crate::server::ProjectConfig;
|
||||||
#[cfg(feature = "slang")]
|
|
||||||
use path_clean::PathClean;
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use ropey::Rope;
|
use ropey::Rope;
|
||||||
#[cfg(feature = "slang")]
|
|
||||||
use std::env::current_dir;
|
|
||||||
#[cfg(feature = "slang")]
|
|
||||||
use std::path::Path;
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use tower_lsp::lsp_types::*;
|
use tower_lsp::lsp_types::*;
|
||||||
#[cfg(feature = "slang")]
|
|
||||||
use veridian_slang::slang_compile;
|
|
||||||
use walkdir::DirEntry;
|
use walkdir::DirEntry;
|
||||||
#[cfg(feature = "slang")]
|
|
||||||
use walkdir::WalkDir;
|
|
||||||
|
|
||||||
#[cfg(feature = "slang")]
|
#[cfg(feature = "slang")]
|
||||||
pub fn get_diagnostics(
|
pub fn get_diagnostics(
|
||||||
|
@ -16,7 +16,7 @@ mod support;
|
|||||||
use server::Backend;
|
use server::Backend;
|
||||||
|
|
||||||
#[derive(StructOpt, Debug)]
|
#[derive(StructOpt, Debug)]
|
||||||
#[structopt(name = "veridian", about = "A SystemVerilog/Verilog Language Server")]
|
#[structopt(name = "Digtal LSP", about = "LSP for Digital IDE")]
|
||||||
struct Opt {}
|
struct Opt {}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@ -25,7 +25,8 @@ async fn main() {
|
|||||||
let log_handle = flexi_logger::Logger::with(flexi_logger::LogSpecification::info())
|
let log_handle = flexi_logger::Logger::with(flexi_logger::LogSpecification::info())
|
||||||
.start()
|
.start()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
info!("starting veridian...");
|
|
||||||
|
info!("launch Digital LSP");
|
||||||
|
|
||||||
let stdin = tokio::io::stdin();
|
let stdin = tokio::io::stdin();
|
||||||
let stdout = tokio::io::stdout();
|
let stdout = tokio::io::stdout();
|
||||||
|
@ -296,7 +296,7 @@ impl LanguageServer for Backend {
|
|||||||
}
|
}
|
||||||
async fn initialized(&self, _: InitializedParams) {
|
async fn initialized(&self, _: InitializedParams) {
|
||||||
self.client
|
self.client
|
||||||
.log_message(MessageType::INFO, "veridian initialized!")
|
.log_message(MessageType::INFO, "digital lsp initialized!")
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
async fn shutdown(&self) -> Result<()> {
|
async fn shutdown(&self) -> Result<()> {
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* ------------------------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
import { workspace, ExtensionContext } from "vscode";
|
import { workspace, ExtensionContext } from "vscode";
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
LanguageClient,
|
LanguageClient,
|
||||||
@ -17,8 +18,13 @@ const workSpaceFolder = workspace.workspaceFolders?.[0];
|
|||||||
let cwd: string = workSpaceFolder.uri.fsPath;
|
let cwd: string = workSpaceFolder.uri.fsPath;
|
||||||
|
|
||||||
export function activate(context: ExtensionContext) {
|
export function activate(context: ExtensionContext) {
|
||||||
|
const lspServerPath = path.resolve(
|
||||||
|
context.extensionPath, '..', '..', 'target', 'debug', 'digital-lsp.exe'
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('launch lsp in ', lspServerPath);
|
||||||
const run: Executable = {
|
const run: Executable = {
|
||||||
command: context.asAbsolutePath('target/debug/digital-lsp.exe'),
|
command: lspServerPath,
|
||||||
// options: { cwd },
|
// options: { cwd },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user