Skip to content

Commit af1a10a

Browse files
aspeddrozth
authored andcommitted
docgen: polish (#825)
1 parent f899f94 commit af1a10a

File tree

6 files changed

+2
-85
lines changed

6 files changed

+2
-85
lines changed

analysis/src/DocExtraction.ml

+2-2
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

-1
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

-50
This file was deleted.

client/src/extension.ts

-3
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ export function activate(context: ExtensionContext) {
203203
customCommands.openCompiled(client);
204204
});
205205

206-
commands.registerCommand("rescript-vscode.extract_docs", () => {
207-
customCommands.extractDocs(client);
208-
});
209206

210207
commands.registerCommand(
211208
"rescript-vscode.go_to_location",

package.json

-4
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

-25
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
@@ -975,24 +970,6 @@ function createInterface(msg: p.RequestMessage): p.Message {
975970
}
976971
}
977972

978-
function extractDocs(msg: p.RequestMessage): p.Message {
979-
let params = msg.params as p.TextDocumentIdentifier;
980-
let filePath = fileURLToPath(params.uri);
981-
982-
let response = utils.runAnalysisCommand(
983-
filePath,
984-
["extractDocs", filePath],
985-
msg
986-
);
987-
988-
let res: p.ResponseMessage = {
989-
jsonrpc: c.jsonrpcVersion,
990-
id: msg.id,
991-
result: response.result,
992-
};
993-
return res;
994-
}
995-
996973
function openCompiledFile(msg: p.RequestMessage): p.Message {
997974
let params = msg.params as p.TextDocumentIdentifier;
998975
let filePath = fileURLToPath(params.uri);
@@ -1258,8 +1235,6 @@ function onMessage(msg: p.Message) {
12581235
send(createInterface(msg));
12591236
} else if (msg.method === openCompiledFileRequest.method) {
12601237
send(openCompiledFile(msg));
1261-
} else if (msg.method === extractDocsRequest.method) {
1262-
send(extractDocs(msg));
12631238
} else if (msg.method === p.InlayHintRequest.method) {
12641239
let params = msg.params as InlayHintParams;
12651240
let extName = path.extname(params.textDocument.uri);

0 commit comments

Comments
 (0)