Skip to content

Commit 16c7582

Browse files
authored
docgen: polish (#825)
1 parent b6ccb7b commit 16c7582

File tree

6 files changed

+2
-85
lines changed

6 files changed

+2
-85
lines changed

analysis/src/DocExtraction.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ let extractDocs ~path ~debug =
237237
FindFiles.isImplementation path = false
238238
&& FindFiles.isInterface path = false
239239
then (
240-
Printf.printf "error: failed to read %s, expected an .res or .resi file\n"
240+
Printf.eprintf "error: failed to read %s, expected an .res or .resi file\n"
241241
path;
242242
exit 1);
243243
let path =
@@ -256,7 +256,7 @@ let extractDocs ~path ~debug =
256256
in
257257
match Cmt.loadFullCmtFromPath ~path with
258258
| None ->
259-
Printf.printf
259+
Printf.eprintf
260260
"error: failed to generate doc for %s, try to build the project\n" path;
261261
exit 1
262262
| Some full ->

client/src/commands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
} from "./commands/code_analysis";
77

88
export { createInterface } from "./commands/create_interface";
9-
export { extractDocs } from "./commands/extract_docs";
109
export { openCompiled } from "./commands/open_compiled";
1110
export { switchImplIntf } from "./commands/switch_impl_intf";
1211

client/src/commands/extract_docs.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

client/src/extension.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,6 @@ export function activate(context: ExtensionContext) {
201201
customCommands.openCompiled(client);
202202
});
203203

204-
commands.registerCommand("rescript-vscode.extract_docs", () => {
205-
customCommands.extractDocs(client);
206-
});
207204

208205
commands.registerCommand(
209206
"rescript-vscode.go_to_location",

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
"command": "rescript-vscode.create_interface",
5050
"title": "ReScript: Create an interface file for this implementation file"
5151
},
52-
{
53-
"command": "rescript-vscode.extract_docs",
54-
"title": "ReScript: Extract documentation as JSON for file."
55-
},
5652
{
5753
"command": "rescript-vscode.open_compiled",
5854
"category": "ReScript",

server/src/server.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ let openCompiledFileRequest = new v.RequestType<
152152
void
153153
>("textDocument/openCompiled");
154154

155-
let extractDocsRequest = new v.RequestType<
156-
p.TextDocumentIdentifier,
157-
p.TextDocumentIdentifier,
158-
void
159-
>("textDocument/extractDocs");
160155

161156
let getCurrentCompilerDiagnosticsForFile = (
162157
fileUri: string
@@ -971,24 +966,6 @@ function createInterface(msg: p.RequestMessage): p.Message {
971966
}
972967
}
973968

974-
function extractDocs(msg: p.RequestMessage): p.Message {
975-
let params = msg.params as p.TextDocumentIdentifier;
976-
let filePath = fileURLToPath(params.uri);
977-
978-
let response = utils.runAnalysisCommand(
979-
filePath,
980-
["extractDocs", filePath],
981-
msg
982-
);
983-
984-
let res: p.ResponseMessage = {
985-
jsonrpc: c.jsonrpcVersion,
986-
id: msg.id,
987-
result: response.result,
988-
};
989-
return res;
990-
}
991-
992969
function openCompiledFile(msg: p.RequestMessage): p.Message {
993970
let params = msg.params as p.TextDocumentIdentifier;
994971
let filePath = fileURLToPath(params.uri);
@@ -1254,8 +1231,6 @@ function onMessage(msg: p.Message) {
12541231
send(createInterface(msg));
12551232
} else if (msg.method === openCompiledFileRequest.method) {
12561233
send(openCompiledFile(msg));
1257-
} else if (msg.method === extractDocsRequest.method) {
1258-
send(extractDocs(msg));
12591234
} else if (msg.method === p.InlayHintRequest.method) {
12601235
let params = msg.params as InlayHintParams;
12611236
let extName = path.extname(params.textDocument.uri);

0 commit comments

Comments
 (0)