Guest User

Untitled

a guest
Jan 20th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. syntax = "proto3";
  2.  
  3. package ch.epfl.scala.bsp.schema;
  4.  
  5. // LSP data structures
  6.  
  7. message TextDocumentIdentifier {
  8. string uri = 1;
  9. }
  10.  
  11. // BSP data structures
  12.  
  13. message BuildTarget {
  14. BuildTargetIdentifier id = 1;
  15. string displayName = 2;
  16. repeated string languageIds = 3;
  17. bytes data = 4;
  18. }
  19.  
  20. message BuildTargetIdentifier {
  21. string uri = 1;
  22. }
  23.  
  24. // Actual protocol
  25.  
  26. // Request: 'build/initialize', C -> S
  27. message InitializeBuildParams {
  28. string rootUri = 1;
  29. BuildClientCapabilities capabilities = 2;
  30. }
  31.  
  32. message BuildClientCapabilities {
  33. repeated string languageIds = 1;
  34. // TODO
  35. }
  36.  
  37. message InitializeBuildResult {
  38. BuildServerCapabilities capabilities = 1;
  39. }
  40.  
  41. message BuildServerCapabilities {
  42. bool compileProvider = 1;
  43. bool textDocumentBuildTargetsProvider = 2;
  44. bool dependencySourcesProvider = 3;
  45. bool buildTargetChangedProvider = 4;
  46. }
  47.  
  48. // Notification: 'build/initialized', C -> S
  49. message InitializedBuildParams {}
  50.  
  51. // Request: 'build/shutdown', C -> S
  52. // Notification: 'build/exit'
  53.  
  54. // Request: 'workspace/buildTargets'
  55. message WorkspaceBuildTargetsRequest {
  56. // NOTE: We may want filtering capabilities here, but in that case we should go for a general,
  57. // standard solution like graphql or SQL to allow both simple and complex queries. We should be
  58. // careful not to add basic filtering capabilities that slowly grow into our ad-hoc query lang.
  59. }
  60.  
  61. message WorkspaceBuildTargets {
  62. repeated BuildTarget targets = 1;
  63. }
  64.  
  65. // Notification: 'buildTarget/didChange', S -> C
  66. message DidChangeBuildTargetParams {
  67. repeated BuildTargetEvent changes = 1;
  68. }
  69.  
  70. message BuildTargetEvent {
  71. BuildTargetIdentifier uri = 1;
  72. Kind kind = 2;
  73.  
  74. enum Kind {
  75. UNKNOWN = 0;
  76. CREATED = 1;
  77. CHANGED = 2;
  78. DELETED = 3;
  79. }
  80. }
  81.  
  82. // Request: 'buildTarget/textDocument', C -> S
  83. message BuildTargetTextDocumentsParams {
  84. repeated BuildTargetIdentifier targets = 1;
  85. }
  86.  
  87. message BuildTargetTextDocuments {
  88. repeated TextDocumentIdentifier textDocuments = 1;
  89. }
  90.  
  91. // Request: 'textDocument/buildTarget', C -> S
  92. message TextDocumentBuildTargetsParams {
  93. TextDocumentIdentifier textDocument = 1;
  94. }
  95.  
  96. message TextDocumentBuildTargets {
  97. repeated BuildTarget targets = 1;
  98. }
  99.  
  100. // Request: 'buildTarget/dependencySources', C -> S
  101. message DependencySourcesParams {
  102. repeated BuildTargetIdentifier targets = 1;
  103. }
  104.  
  105. message DependencySources {
  106. repeated DependencySourcesItem items = 1;
  107. }
  108.  
  109. message DependencySourcesItem {
  110. BuildTargetIdentifier target = 1;
  111. repeated string uri = 2;
  112. }
  113.  
  114. // Request: 'buildTarget/compile', C -> S
  115. message CompileParams {
  116. repeated BuildTargetIdentifier targets = 1;
  117. }
  118.  
  119. message CompileReport {
  120. repeated CompileReportItem items = 1;
  121. }
  122.  
  123. message CompileReportItem {
  124. BuildTargetIdentifier target = 1;
  125. int64 errors = 2;
  126. int64 warnings = 3;
  127. int64 time = 4;
  128. int64 linesOfCode = 5;
  129. }
  130.  
  131. // Scala extension
  132.  
  133. message ScalaBuildTarget {
  134. string scalaOrganization = 1;
  135. string scalaVersion = 2;
  136. string scalaBinaryVersion = 3;
  137. }
  138.  
  139. // Request: 'buildTarget/scalacOptions', C -> S
  140. message ScalacOptionsParams {
  141. repeated BuildTargetIdentifier targets = 1;
  142. }
  143.  
  144. // One could feed these options in to the compiler
  145. message ScalacOptions {
  146. BuildTargetIdentifier target = 1;
  147. repeated string options = 2;
  148. repeated string classpath = 3;
  149. string classDirectory = 4;
  150. }
Add Comment
Please, Sign In to add comment