Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- syntax = "proto3";
- package ch.epfl.scala.bsp.schema;
- // LSP data structures
- message TextDocumentIdentifier {
- string uri = 1;
- }
- // BSP data structures
- message BuildTarget {
- BuildTargetIdentifier id = 1;
- string displayName = 2;
- repeated string languageIds = 3;
- bytes data = 4;
- }
- message BuildTargetIdentifier {
- string uri = 1;
- }
- // Actual protocol
- // Request: 'build/initialize', C -> S
- message InitializeBuildParams {
- string rootUri = 1;
- BuildClientCapabilities capabilities = 2;
- }
- message BuildClientCapabilities {
- repeated string languageIds = 1;
- // TODO
- }
- message InitializeBuildResult {
- BuildServerCapabilities capabilities = 1;
- }
- message BuildServerCapabilities {
- bool compileProvider = 1;
- bool textDocumentBuildTargetsProvider = 2;
- bool dependencySourcesProvider = 3;
- bool buildTargetChangedProvider = 4;
- }
- // Notification: 'build/initialized', C -> S
- message InitializedBuildParams {}
- // Request: 'build/shutdown', C -> S
- // Notification: 'build/exit'
- // Request: 'workspace/buildTargets'
- message WorkspaceBuildTargetsRequest {
- // NOTE: We may want filtering capabilities here, but in that case we should go for a general,
- // standard solution like graphql or SQL to allow both simple and complex queries. We should be
- // careful not to add basic filtering capabilities that slowly grow into our ad-hoc query lang.
- }
- message WorkspaceBuildTargets {
- repeated BuildTarget targets = 1;
- }
- // Notification: 'buildTarget/didChange', S -> C
- message DidChangeBuildTargetParams {
- repeated BuildTargetEvent changes = 1;
- }
- message BuildTargetEvent {
- BuildTargetIdentifier uri = 1;
- Kind kind = 2;
- enum Kind {
- UNKNOWN = 0;
- CREATED = 1;
- CHANGED = 2;
- DELETED = 3;
- }
- }
- // Request: 'buildTarget/textDocument', C -> S
- message BuildTargetTextDocumentsParams {
- repeated BuildTargetIdentifier targets = 1;
- }
- message BuildTargetTextDocuments {
- repeated TextDocumentIdentifier textDocuments = 1;
- }
- // Request: 'textDocument/buildTarget', C -> S
- message TextDocumentBuildTargetsParams {
- TextDocumentIdentifier textDocument = 1;
- }
- message TextDocumentBuildTargets {
- repeated BuildTarget targets = 1;
- }
- // Request: 'buildTarget/dependencySources', C -> S
- message DependencySourcesParams {
- repeated BuildTargetIdentifier targets = 1;
- }
- message DependencySources {
- repeated DependencySourcesItem items = 1;
- }
- message DependencySourcesItem {
- BuildTargetIdentifier target = 1;
- repeated string uri = 2;
- }
- // Request: 'buildTarget/compile', C -> S
- message CompileParams {
- repeated BuildTargetIdentifier targets = 1;
- }
- message CompileReport {
- repeated CompileReportItem items = 1;
- }
- message CompileReportItem {
- BuildTargetIdentifier target = 1;
- int64 errors = 2;
- int64 warnings = 3;
- int64 time = 4;
- int64 linesOfCode = 5;
- }
- // Scala extension
- message ScalaBuildTarget {
- string scalaOrganization = 1;
- string scalaVersion = 2;
- string scalaBinaryVersion = 3;
- }
- // Request: 'buildTarget/scalacOptions', C -> S
- message ScalacOptionsParams {
- repeated BuildTargetIdentifier targets = 1;
- }
- // One could feed these options in to the compiler
- message ScalacOptions {
- BuildTargetIdentifier target = 1;
- repeated string options = 2;
- repeated string classpath = 3;
- string classDirectory = 4;
- }
Add Comment
Please, Sign In to add comment