class

Detector::Specification::HttpFile

Inherits Detector < Reference < Object

Constants

REQUEST_LINE = /^[ \t]*(?:#{(ALLOWED_HTTP_METHODS - ["QUERY"]).join('|')}|(?-i:QUERY))[ \t]+\S*[.\/:{]/im

A request line: an HTTP method followed by a target whose first token carries a URL-ish char (. / : {). This is the unambiguous signal shared by the VS Code REST Client and JetBrains HTTP Client dialects, and requiring the URL-ish char keeps .rest reStructuredText prose ("Get started with the API", "Delete the file") from matching.

The alternation is derived from ALLOWED_HTTP_METHODS — the analyzer parses every verb in that list, so a file whose only request uses one must still be detected here. QUERY alone is matched case-sensitively: unlike the classic verbs, English prose idiomatically puts a URL-ish token right after "Query" ("Query /users for the list."), so the lenient match that is safe for GET/POST would fabricate endpoints from documentation. The analyzer applies the same uppercase rule.

Class methods

tech_name

The tech name without needing an instance, so the registry can be read off the classes themselves rather than from a parallel list.

Source

Instance methods

applicable?(filename : String) : Bool

Registers .http / .rest request-file paths in CodeLocator.

Source
detect(filename : String, file_contents : String) : Bool
Source
idempotent?

Registers .http / .rest request-file paths in CodeLocator.

Source
set_name

Registers .http / .rest request-file paths in CodeLocator.

Source