Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
T
Typer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
Stefan
Typer
Compare revisions
a4a9cf9e4aea9600b10c2c96551d7130b7f6d5b4 to 1b7204e398917b1759174aab4dd89a4b9ee45c95
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
monnier/typer
Select target project
No results found
1b7204e398917b1759174aab4dd89a4b9ee45c95
Select Git revision
Branches
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
Swap
Target
monnier/typer
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
a4a9cf9e4aea9600b10c2c96551d7130b7f6d5b4
Select Git revision
Branches
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
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
diagnostics
· cc0bd4d8
Soilihi BEN SOILIHI BOINA
authored
4 years ago
cc0bd4d8
Errors handling
· 1b7204e3
Soilihi BEN SOILIHI BOINA
authored
4 years ago
1b7204e3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.vscode/launch.json
+15
-0
15 additions, 0 deletions
.vscode/launch.json
emacs/typer-mode.el
+13
-0
13 additions, 0 deletions
emacs/typer-mode.el
src/REPL.ml
+4
-3
4 additions, 3 deletions
src/REPL.ml
src/dune
+2
-2
2 additions, 2 deletions
src/dune
src/typer_lsp_server.ml
+35
-5
35 additions, 5 deletions
src/typer_lsp_server.ml
with
69 additions
and
10 deletions
.vscode/launch.json
0 → 100644
View file @
1b7204e3
{
//
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
This diff is collapsed.
Click to expand it.
emacs/typer-mode.el
View file @
1b7204e3
...
...
@@ -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
This diff is collapsed.
Click to expand it.
src/REPL.ml
View file @
1b7204e3
...
...
@@ -54,7 +54,7 @@ module OL = Opslexp
module
EL
=
Elexp
let
arg_batch
=
ref
false
let
lsp_server
=
ref
fals
e
let
lsp_server
=
ref
tru
e
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
=
...
...
This diff is collapsed.
Click to expand it.
src/dune
View file @
1b7204e3
;; -*- lisp-data -*-
(executable
(name REPL)
(name REPL
)
;; (public_name typer)
(libraries "zarith" "str"
"linol" "linol-lwt"
"lsp" "jsonrpc"
)
)
\ No newline at end of file
)
This diff is collapsed.
Click to expand it.
src/typer_lsp_server.ml
View file @
1b7204e3
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.