Skip to content

[Docgen]: Polish #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions analysis/src/DocExtraction.ml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ let extractDocs ~path ~debug =
FindFiles.isImplementation path = false
&& FindFiles.isInterface path = false
then (
Printf.printf "error: failed to read %s, expected an .res or .resi file\n"
Printf.eprintf "error: failed to read %s, expected an .res or .resi file\n"
path;
exit 1);
let path =
Expand All @@ -256,7 +256,7 @@ let extractDocs ~path ~debug =
in
match Cmt.loadFullCmtFromPath ~path with
| None ->
Printf.printf
Printf.eprintf
"error: failed to generate doc for %s, try to build the project\n" path;
exit 1
| Some full ->
Expand Down
1 change: 0 additions & 1 deletion client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from "./commands/code_analysis";

export { createInterface } from "./commands/create_interface";
export { extractDocs } from "./commands/extract_docs";
export { openCompiled } from "./commands/open_compiled";
export { switchImplIntf } from "./commands/switch_impl_intf";

Expand Down
50 changes: 0 additions & 50 deletions client/src/commands/extract_docs.ts

This file was deleted.

3 changes: 0 additions & 3 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ export function activate(context: ExtensionContext) {
customCommands.openCompiled(client);
});

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

commands.registerCommand(
"rescript-vscode.go_to_location",
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
"command": "rescript-vscode.create_interface",
"title": "ReScript: Create an interface file for this implementation file"
},
{
"command": "rescript-vscode.extract_docs",
"title": "ReScript: Extract documentation as JSON for file."
},
{
"command": "rescript-vscode.open_compiled",
"category": "ReScript",
Expand Down
25 changes: 0 additions & 25 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ let openCompiledFileRequest = new v.RequestType<
void
>("textDocument/openCompiled");

let extractDocsRequest = new v.RequestType<
p.TextDocumentIdentifier,
p.TextDocumentIdentifier,
void
>("textDocument/extractDocs");

let getCurrentCompilerDiagnosticsForFile = (
fileUri: string
Expand Down Expand Up @@ -971,24 +966,6 @@ function createInterface(msg: p.RequestMessage): p.Message {
}
}

function extractDocs(msg: p.RequestMessage): p.Message {
let params = msg.params as p.TextDocumentIdentifier;
let filePath = fileURLToPath(params.uri);

let response = utils.runAnalysisCommand(
filePath,
["extractDocs", filePath],
msg
);

let res: p.ResponseMessage = {
jsonrpc: c.jsonrpcVersion,
id: msg.id,
result: response.result,
};
return res;
}

function openCompiledFile(msg: p.RequestMessage): p.Message {
let params = msg.params as p.TextDocumentIdentifier;
let filePath = fileURLToPath(params.uri);
Expand Down Expand Up @@ -1254,8 +1231,6 @@ function onMessage(msg: p.Message) {
send(createInterface(msg));
} else if (msg.method === openCompiledFileRequest.method) {
send(openCompiledFile(msg));
} else if (msg.method === extractDocsRequest.method) {
send(extractDocs(msg));
} else if (msg.method === p.InlayHintRequest.method) {
let params = msg.params as InlayHintParams;
let extName = path.extname(params.textDocument.uri);
Expand Down