Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • SimonJ
  • add-proj
  • alice
  • case-unification
  • compiler-phase-simpl
  • dev/characterization
  • diagnostics_and_hover
  • feedback/graveline
  • gambit-compile-pervasives
  • gensym-without-spaces
  • instance-args
  • ja--elab-flamecharts
  • ja-barszcz
  • ja-perf
  • ja-refl
  • laurent/elab_cache
  • location-sinfo
  • main
  • master
  • misc-bugfixes
  • ocaml-toplevel
  • open-module
  • quot-types/normalisation
  • quot-types/rational
  • report/hmdup
  • report/itd
  • report/jfla-2019
  • report/ml-2017
  • report/tcvi
  • report/vincent-bonnevalle
  • residue-fix
  • residues-elab
  • sexp-case
  • simon--logging-overhaul
  • simon--pp-print-lctx
  • simon--pp-print-value
  • simon--remove-heap
  • simon--trace-evaluation-through-logging
  • there-can-be-only-one-inductive
  • tp/ift6172
  • trace-vs-diagnose
  • track-sexp-lexp
  • typer-lsp-server
43 results

Target

Select target project
  • monnier/typer
  • league/typer
  • jamestjw/typer
  • rdivyanshu/typer
  • jabarszcz/typer
  • JasonHuZS/typer
  • npereira97/typer
  • hannelita/typer
  • khaledPac/typer
  • shonfeder/typer
10 results
Select Git revision
  • SimonJ
  • add-proj
  • alice
  • case-unification
  • compiler-phase-simpl
  • dev/characterization
  • diagnostics_and_hover
  • feedback/graveline
  • gambit-compile-pervasives
  • gensym-without-spaces
  • instance-args
  • ja--elab-flamecharts
  • ja-barszcz
  • ja-perf
  • ja-refl
  • laurent/elab_cache
  • location-sinfo
  • main
  • master
  • misc-bugfixes
  • ocaml-toplevel
  • open-module
  • quot-types/normalisation
  • quot-types/rational
  • report/hmdup
  • report/itd
  • report/jfla-2019
  • report/ml-2017
  • report/tcvi
  • report/vincent-bonnevalle
  • residue-fix
  • residues-elab
  • sexp-case
  • simon--logging-overhaul
  • simon--pp-print-lctx
  • simon--pp-print-value
  • simon--remove-heap
  • simon--trace-evaluation-through-logging
  • there-can-be-only-one-inductive
  • tp/ift6172
  • trace-vs-diagnose
  • track-sexp-lexp
  • typer-lsp-server
43 results
Show changes
Commits on Source (2)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
\ No newline at end of file
......@@ -279,5 +279,18 @@
(easy-menu-add typer-mode-menu)
)
(defvar typer-lsp-server-command '("typer-lsp-server"))
(with-eval-after-load 'lsp-mode
(lsp-register-client
(make-lsp-client :new-connection
(lsp-stdio-connection
(lambda () typer-lsp-server-command))
:major-modes '(typer-mode)
:priority -1
:server-id 'typer-ls)))
(provide 'typer-mode)
;;; typer-mode.el ends here
......@@ -54,7 +54,7 @@ module OL = Opslexp
module EL = Elexp
let arg_batch = ref false
let lsp_server = ref false
let lsp_server = ref true
let print_input_line i =
print_string " In[";
......@@ -207,8 +207,9 @@ let help_msg =
let readstring (str:string) =
let ectx = Elab.default_ectx in
(*let rctx = Elab.default_rctx in*)
let (list, _) = Elab.lexp_decl_str str ectx in
list
Elab.lexp_decl_str str ectx ;
let ret = Log.typer_log in
ret
let readfiles files (i, lctx, rctx) prt =
......
;; -*- lisp-data -*-
(executable
(name REPL)
(name REPL )
;; (public_name typer)
(libraries "zarith" "str"
"linol" "linol-lwt"
"lsp" "jsonrpc"
)
)
\ No newline at end of file
)
......@@ -36,15 +36,45 @@
Diagnostics includes all the warnings, errors and messages that the processing
of a document are expected to be able to return.
*)
open Log
open Util
type state_after_processing = log_entry list
type state_after_processing = unit
let log_entry_to_list (tab:log_entry list) : ((string * int * int * string) * log_level * string) list =
List.map (fun x -> let location = Option.get x.loc in
((location.file,location.line,location.column,location.docstr)
,x.level,x.msg)
) tab
let process_some_input_file (_file_contents : string) : state_after_processing =
()
let log_level_to_severity (level:log_level) : Lsp.Types.DiagnosticSeverity.t =
match level with
| Error -> Lsp.Types.DiagnosticSeverity.Error
| Warning -> Lsp.Types.DiagnosticSeverity.Warning
| Info -> Lsp.Types.DiagnosticSeverity.Information
| _ -> Lsp.Types.DiagnosticSeverity.Hint
let diagnostics (_state : state_after_processing ) : Lsp.Types.Diagnostic.t list =
[]
let process_some_input_file (_file_contents : string) : state_after_processing =
REPL.readstring _file_contents
let diagnostics (_state : state_after_processing) : Lsp.Types.Diagnostic.t list =
let log_tab = log_entry_to_list _state in
List.map (fun x ->
let (loc, lev, msg) = x in
let (_ (* file *), line, column, _ (* docstr *) ) = loc in
let severity = log_level_to_severity lev in
let message = msg in
let start_pos = Lsp.Types.Position.create ~line:line ~character:column in
let end_pos = Lsp.Types.Position.create ~line:line ~character:(column + 1) in
let range = Lsp.Types.Range.create ~start:start_pos ~end_:end_pos in
let diagnostic = Lsp.Types.Diagnostic.create ()
~range:range
~severity:severity
~source:"typerlsp"
~message:message
in
diagnostic
) log_tab
(* Lsp server class
This is the main point of interaction beetween the code checking documents
......