Skip to content

Commit

Permalink
Miscellaneous documentation and spelling improvements (denoland#5527)
Browse files Browse the repository at this point in the history
* Extended/updated documentation on code editor setup and plugins.
* Moved documentation to the right file.
* Fixed spelling errors in documentation and code.
* Updated broken links.

Co-authored-by: 迷渡 <justjavac@gmail.com>
Co-authored-by: AlfieriChou <alfierichou@gmail.com>
Co-authored-by: Anil Seervi <anil13112000@gmail.com
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Fernando Basso <fernandobasso.br@gmail.com>
Co-authored-by: József Sallai <jozsef@sallai.me>
Co-authored-by: S4ltyGo4t <mario.weidner@gmx.de>
Co-authored-by: Tommy May <tommymay37@gmail.com>
Co-authored-by: Turbinya <wownucleos@gmail.com>
Co-authored-by: ᴜɴвʏтᴇ <i@shangyes.net>
  • Loading branch information
9 people committed May 17, 2020
1 parent eddb916 commit 36fde75
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 34 deletions.
4 changes: 2 additions & 2 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static ENV_VARIABLES_HELP: &str = "ENVIRONMENT VARIABLES:

static DENO_HELP: &str = "A secure JavaScript and TypeScript runtime
Docs: https://deno.land/std/manual.md
Docs: https://deno.land/manual
Modules: https://deno.land/std/ https://deno.land/x/
Bugs: https://github.com/denoland/deno/issues
Expand Down Expand Up @@ -1194,7 +1194,7 @@ fn importmap_arg<'a, 'b>() -> Arg<'a, 'b> {
.long_help(
"UNSTABLE:
Load import map file
Docs: https://deno.land/std/manual.md#import-maps
Docs: https://deno.land/manual/linking_to_external_code/import_maps
Specification: https://wicg.github.io/import-maps/
Examples: https://github.com/WICG/import-maps#the-import-map",
)
Expand Down
4 changes: 2 additions & 2 deletions cli/js/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1638,9 +1638,9 @@ declare namespace Deno {
bytesReceived: number;
}

/** Receive metrics from the privileged side of Deno. This is primarily used
/** Receive metrics from the privileged side of Deno. This is primarily used
* in the development of Deno. 'Ops', also called 'bindings', are the go-between
* between Deno Javascript and Deno Rust.
* between Deno JavaScript and Deno Rust.
*
* > console.table(Deno.metrics())
* ┌─────────────────────────┬────────┐
Expand Down
2 changes: 1 addition & 1 deletion cli/js/lib.deno.unstable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ declare namespace Deno {
/** **UNSTABLE**: new API, yet to be vetted.
*
* `bundle()` is part the compiler API. A full description of this functionality
* can be found in the [manual](https://deno.land/std/manual.md#denobundle).
* can be found in the [manual](https://deno.land/manual/runtime/compiler_apis#denobundle).
*
* Takes a root module name, and optionally a record set of sources. Resolves
* with a single JavaScript string (and bundle diagnostics if issues arise with
Expand Down
7 changes: 3 additions & 4 deletions core/isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ pub enum Snapshot {
Boxed(Box<[u8]>),
}

/// Represents data used to initialize isolate at startup
/// either a binary snapshot or a javascript source file
/// in the form of the StartupScript struct.
/// Represents data used to initialize an isolate at startup, either
/// in the form of a binary snapshot or a JavaScript source file.
pub enum StartupData<'a> {
Script(Script<'a>),
Snapshot(Snapshot),
Expand All @@ -142,7 +141,7 @@ type IsolateErrorHandleFn = dyn FnMut(ErrBox) -> Result<(), ErrBox>;

/// A single execution context of JavaScript. Corresponds roughly to the "Web
/// Worker" concept in the DOM. An CoreIsolate is a Future that can be used with
/// Tokio. The CoreIsolate future complete when there is an error or when all
/// Tokio. The CoreIsolate future completes when there is an error or when all
/// pending ops have completed.
///
/// Ops are created in JavaScript by calling Deno.core.dispatch(), and in Rust
Expand Down
18 changes: 16 additions & 2 deletions docs/getting_started/setup_your_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ or imports having unnecessary file extensions.

The community has developed extensions for some editors to solve these issues:

- [VS Code](https://marketplace.visualstudio.com/items?itemName=axetroy.vscode-deno)
by [@axetroy](https://github.com/axetroy).
#### VS Code

The beta version of [vscode_deno](https://github.com/denoland/vscode_deno) is
published on the
[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=justjavac.vscode-deno).
Please report any issues.

#### JetBrains IDEs

Support for JetBrains IDEs is not yet available, but you can follow and upvote
these issues to stay up to date:
Expand All @@ -55,6 +61,14 @@ these issues to stay up to date:
- https://youtrack.jetbrains.com/issue/WEB-42983
- https://youtrack.jetbrains.com/issue/WEB-31667

#### Vim and NeoVim

Vim works fairly well for Deno/TypeScript if you install
[CoC](https://github.com/neoclide/coc.nvim) (intellisense engine and language
server protocol). After CoC itself is installed, from inside Vim, simply run
`:CocInstall coc-deno`. From now on, things like `gd` (go to definition) and
`gr` (goto/find references) should work.

If you don't see your favorite IDE on this list, maybe you can develop an
extension. Our [community Discord group](https://discord.gg/TGMHGv6) can give
you some pointers on where to get started.
2 changes: 1 addition & 1 deletion docs/runtime/program_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ got unload event in event handler (main)
```

All listeners added using `window.addEventListener` were run, but
`window.onload` and `window.onunload` defined in `main.ts` overridden handlers
`window.onload` and `window.onunload` defined in `main.ts` overrode handlers
defined in `imported.ts`.
2 changes: 1 addition & 1 deletion std/fmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This is very much a work-in-progress. I'm actively soliciting feedback.
format each element according to the format (surrounded by [] and separated by
comma) (`<` Mnemonic: pull each element out of array)

- how to deal with more newfangled Javascript features ( generic Iterables, Map
- how to deal with more newfangled JavaScript features (generic Iterables, Map
and Set types, typed Arrays, ...)

- the implementation is fairly rough around the edges:
Expand Down
20 changes: 3 additions & 17 deletions std/fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ fs module is made to provide helpers to manipulate the filesystem.

## Usage

All the following modules are exposed in `mod.ts`
All the following modules are exposed in `mod.ts` This feature is currently
unstable. To enable it use `deno run --unstable`

### emptyDir

Expand Down Expand Up @@ -59,7 +60,7 @@ ensureSymlink("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // ret
ensureSymlinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // void
```

### eol
### EOL

Detects and format the passed string for the targeted End Of Line character.

Expand Down Expand Up @@ -91,21 +92,6 @@ exists("./foo"); // returns a Promise<boolean>
existsSync("./foo"); // returns boolean
```

### globToRegExp

Generate a regex based on glob pattern and options This was meant to be using
the the `fs.walk` function but can be used anywhere else.

```ts
import { globToRegExp } from "https://deno.land/std/fs/mod.ts";

globToRegExp("foo/**/*.json", {
flags: "g",
extended: true,
globstar: true,
}); // returns the regex to find all .json files in the folder foo
```

### move

Moves a file or directory. Overwrites it if option provided
Expand Down
2 changes: 1 addition & 1 deletion std/fs/empty_dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function emptyDirSync(dir: string): void {
try {
const items = [...readDirSync(dir)];

// if directory already exist. then remove it's child item.
// If the directory exists, remove all entries inside it.
while (items.length) {
const item = items.shift();
if (item && item.name) {
Expand Down
2 changes: 1 addition & 1 deletion std/http/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface Cookie {
path?: string;
/** Indicates if the cookie is made using SSL & HTTPS. */
secure?: boolean;
/** Indicates that cookie is not accessible via Javascript. **/
/** Indicates that cookie is not accessible via JavaScript. **/
httpOnly?: boolean;
/** Allows servers to assert that a cookie ought not to
* be sent along with cross-site requests. */
Expand Down
2 changes: 1 addition & 1 deletion std/io/ioutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function readLong(buf: BufReader): Promise<number | null> {
// We probably should provide a similar API that returns BigInt values.
if (big > MAX_SAFE_INTEGER) {
throw new RangeError(
"Long value too big to be represented as a Javascript number."
"Long value too big to be represented as a JavaScript number."
);
}
return Number(big);
Expand Down
1 change: 0 additions & 1 deletion std/manual.md

This file was deleted.

15 changes: 15 additions & 0 deletions std/path/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ Usage:
```ts
import * as path from "https://deno.land/std/path/mod.ts";
```

### globToRegExp

Generate a regex based on glob pattern and options This was meant to be using
the the `fs.walk` function but can be used anywhere else.

```ts
import { globToRegExp } from "https://deno.land/std/path/glob.ts";

globToRegExp("foo/**/*.json", {
flags: "g",
extended: true,
globstar: true,
}); // returns the regex to find all .json files in the folder foo
```

0 comments on commit 36fde75

Please sign in to comment.