HNCode²
HNCode² is the successor to HNCode , an extension no longer being developed. The idea behind HNCode was to provide a custom webview inside VSCode to browse Hacker News, eventually adding a code style view. However, due to the extreme simplicity of Hacker News itself, it made sense to instead provide it as a Tree View, for more discreet browsing in VSCode. This is HNCode².
Features
Browse Top, New, Ask and Show HN in a tree view.
Go straight to external URLs or self posts from the tree view.
Expand the items to reveal amount of comments.
Click on expanded items to go straight to the comments in Hacker News.
Requirements
This extension requires Visual Studio Code 1.38.0 or later to work properly.
Extension Settings
This extension contributes the following settings:
hncode2.limitation
: Set the amount of items to be loaded on the front page.
hncode2.defaultView
: Set the Default View of the tree view. Possible items are: 'top', 'new', 'ask' and 'show'.
hncode2.requestTimeout
: Set the timeout for requests in milliseconds (ms).
Known Issues
Sometimes, requests may time out without an appropriate error being displayed.
Documentation
The documentation for this extension is available at https://www.soeren.codes/hncode2/ and provided via TypeDoc.
Release Notes
1.0.1
CHANGED: Request Timeout down from 10.000 ms to 500 ms.
1.0.0
NEW: Better error handling when no internet connectioon present (thanks to @ekarbe!)
NEW: Integration tests for API calls.
0.5.0
NEW: Added socket timeout to API calls.
NEW: Selected entries (Top, New etc) are now greyed out.
REMOVED: Unnecessary image resources.
CHANGED: This extension is no longer a preview.
0.1.5
NEW: Hosted documentation provided by TypeDoc.
FIXED: Routing errors in documentation.
FIXED: Various bugfixes.
0.1.1
CHANGED: Removed unnecessary API calls in extension.ts (thanks @ekarbe!)
0.1.0
NEW: Marketplace Icon added.
0.0.9
CHANGED: HNCode² is now named Hacker News for VSCode to increase visibility in Marketplace.
0.0.8
NEW: The amount of comments is now shown when expanding a story in tree view.
NEW: A link to comment section has been provided when clicking on "x comments".
FIXES: Various.
0.0.5
NEW: Browse Ask, Top, Show and New HN through Context Actions.
NEW: Go straight to external URL when clicking on story, including Ask and Show HN.
IN PROGRESS: Show link to comments when expanding a story.
FIXED: Bad URL when clicking on HN self posts.
FIXED: No longer show post ID next to post.
IN PROGRESS: Display 1 to n numbers next to entries.
0.0.1
Pre-alpha Release
Variables
Const BASE_URL
BASE_URL: "https://hacker-news.firebaseio.com/v0/" = "https://hacker-news.firebaseio.com/v0/"
Const config
config: WorkspaceConfiguration = vscode.workspace.getConfiguration("hncode2")
Const restClient
restClient: RestClient = new rm.RestClient('hncode', BASE_URL, undefined, { socketTimeout: config.requestTimeout })
Functions
activate
activate( context: ExtensionContext ) : Promise < void >
Parameters
context: ExtensionContext
Returns Promise < void >
getAsk
getAsk( ) : Promise < Array < number > >
Returns Promise < Array < number > >
getNew
getNew( ) : Promise < Array < number > >
Returns Promise < Array < number > >
getShow
getShow( ) : Promise < Array < number > >
Returns Promise < Array < number > >
getStories
getStories( stories: Array < number > ) : Promise < HNData [] >
Parameters
Returns Promise < HNData [] >
getStory
getStory( id?: undefined | string ) : Promise < HNData >
Parameters
Optional id: undefined | string
Returns Promise < HNData >
getTop
getTop( ) : Promise < Array < number > >
Returns Promise < Array < number > >
Legend
Module
Object literal
Variable
Function
Function with type parameter
Index signature
Type alias
Type alias with type parameter
Enumeration
Enumeration member
Property
Method
Interface
Interface with type parameter
Constructor
Property
Method
Index signature
Class
Class with type parameter
Constructor
Property
Method
Accessor
Index signature
Inherited constructor
Inherited property
Inherited method
Inherited accessor
Protected property
Protected method
Protected accessor
Private property
Private method
Private accessor
Static property
Static method
Base URL of Hacker News API.